this post was submitted on 17 Jul 2024
1 points (100.0% liked)

nginx

4 readers
1 users here now

The nginx community on Reddit. Reddit gives you the best of the internet in one place.

founded 1 year ago
MODERATORS
 
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???

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here