The original post: /r/nginx by /u/MRgabbar on 2024-07-17 15:36:48.
Seems to be working on Chrome/Chromium/WebKit just fine, but Firefox either times out or just says security risk when using the www.
This is my current configuration:
server {
listen 80;
server_name example.com www.example.com;
if ($host = www.example.com) {
return 301 https://example.com$request_uri;
}
# Redirect all HTTP requests to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name
example.com
;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
root /var/www/example.com;
index index.html;
location / {
try_files $uri /index.html;
}
}
Anything wrong with it???