47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name dokindthings.fund www.dokindthings.fund;
|
|
|
|
# Redirect HTTP to HTTPS
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name dokindthings.fund www.dokindthings.fund;
|
|
|
|
# SSL Certificate paths (update these with your actual certificate paths)
|
|
ssl_certificate /etc/letsencrypt/live/dokindthings.fund/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/dokindthings.fund/privkey.pem;
|
|
|
|
# SSL configuration
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
# Logging
|
|
access_log /var/log/nginx/dokindthings.fund.access.log;
|
|
error_log /var/log/nginx/dokindthings.fund.error.log;
|
|
|
|
# Proxy settings
|
|
location / {
|
|
proxy_pass http://localhost:3001;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# Security headers
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
}
|