githaven/nginx-template
Caretaker0699 07a1d98575
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-docker-rootful (push) Has been cancelled
release-nightly / nightly-docker-rootless (push) Has been cancelled
cron-licenses / cron-licenses (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled
add nginx default template
2024-08-15 19:54:34 +00:00

48 lines
1.6 KiB
Plaintext

server {
server_name your-website.org www.your-website.org;
add_header Strict-Transport-Security max-age=31536000;
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "default-src 'self' data:; script-src 'self' 'unsafe-inline' data:; font-src 'self' data:; manifest-src 'self' data:; style-src 'self' 'unsafe-inline' data:; img-src 'self' data: https://secure.gravatar.com";
client_max_body_size 500m;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
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;
proxy_read_timeout 86400;
}
listen 443 http2 ssl;
listen [::]:443 http2 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/YOURWEBSITE/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/YOURWEBSITE/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.your-website.org) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = your-website.org) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name your-website.org www.your-website.org;
return 404; # managed by Certbot
}