Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map $http_upgrade $connection_upgrade {
- default upgrade;
- '' close;
- }
- server {
- listen 80;
- server_name appwrite.lostcausenetwork.com;
- return 301 https://$host$request_uri;
- }
- server {
- listen 443 ssl http2;
- server_name appwrite.lostcausenetwork.com;
- ssl_certificate /etc/letsencrypt/live/appwrite.lostcausenetwork.com/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/appwrite.lostcausenetwork.com/privkey.pem;
- ssl_session_cache shared:SSL:10m;
- ssl_protocols TLSv1.2 TLSv1.3;
- ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
- ssl_prefer_server_ciphers on;
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Robots-Tag none;
- add_header Content-Security-Policy "frame-ancestors 'self'";
- add_header X-Frame-Options DENY;
- add_header Referrer-Policy same-origin;
- location ^~ /.well-known/acme-challenge/ {
- root /var/www/letsencrypt;
- try_files $uri =404;
- }
- client_max_body_size 100m;
- client_body_timeout 120s;
- location / {
- # Proxy to Appwrite TLS backend
- proxy_pass https://127.0.0.1:3443;
- # Ensure Appwrite sees public host/proto
- 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 https;
- proxy_set_header X-Forwarded-Host $host;
- proxy_set_header X-Forwarded-Port 443;
- proxy_set_header X-Forwarded-Scheme https;
- proxy_set_header Origin $http_origin;
- # Websockets / upgrades
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $connection_upgrade;
- # SSL for upstream (internal Appwrite uses TLS)
- proxy_ssl_server_name on;
- proxy_ssl_name appwrite.lostcausenetwork.com;
- proxy_ssl_verify off;
- # Prevent nginx changing redirects/cookies coming from Appwrite
- proxy_redirect off;
- proxy_cookie_domain 127.0.0.1 appwrite.lostcausenetwork.com;
- proxy_cookie_path / /;
- proxy_buffering off;
- proxy_request_buffering off;
- proxy_read_timeout 86400;
- proxy_send_timeout 600;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment