Guest User

Untitled

a guest
Dec 6th, 2025
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. map $http_upgrade $connection_upgrade {
  2. default upgrade;
  3. '' close;
  4. }
  5.  
  6. server {
  7. listen 80;
  8. server_name appwrite.lostcausenetwork.com;
  9. return 301 https://$host$request_uri;
  10. }
  11.  
  12. server {
  13. listen 443 ssl http2;
  14. server_name appwrite.lostcausenetwork.com;
  15.  
  16. ssl_certificate /etc/letsencrypt/live/appwrite.lostcausenetwork.com/fullchain.pem;
  17. ssl_certificate_key /etc/letsencrypt/live/appwrite.lostcausenetwork.com/privkey.pem;
  18. ssl_session_cache shared:SSL:10m;
  19. ssl_protocols TLSv1.2 TLSv1.3;
  20. 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";
  21. ssl_prefer_server_ciphers on;
  22.  
  23. add_header X-Content-Type-Options nosniff;
  24. add_header X-XSS-Protection "1; mode=block";
  25. add_header X-Robots-Tag none;
  26. add_header Content-Security-Policy "frame-ancestors 'self'";
  27. add_header X-Frame-Options DENY;
  28. add_header Referrer-Policy same-origin;
  29.  
  30. location ^~ /.well-known/acme-challenge/ {
  31. root /var/www/letsencrypt;
  32. try_files $uri =404;
  33. }
  34.  
  35. client_max_body_size 100m;
  36. client_body_timeout 120s;
  37.  
  38. location / {
  39. # Proxy to Appwrite TLS backend
  40. proxy_pass https://127.0.0.1:3443;
  41.  
  42. # Ensure Appwrite sees public host/proto
  43. proxy_set_header Host $host;
  44. proxy_set_header X-Real-IP $remote_addr;
  45. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  46. proxy_set_header X-Forwarded-Proto https;
  47. proxy_set_header X-Forwarded-Host $host;
  48. proxy_set_header X-Forwarded-Port 443;
  49. proxy_set_header X-Forwarded-Scheme https;
  50. proxy_set_header Origin $http_origin;
  51.  
  52. # Websockets / upgrades
  53. proxy_http_version 1.1;
  54. proxy_set_header Upgrade $http_upgrade;
  55. proxy_set_header Connection $connection_upgrade;
  56.  
  57. # SSL for upstream (internal Appwrite uses TLS)
  58. proxy_ssl_server_name on;
  59. proxy_ssl_name appwrite.lostcausenetwork.com;
  60. proxy_ssl_verify off;
  61.  
  62. # Prevent nginx changing redirects/cookies coming from Appwrite
  63. proxy_redirect off;
  64. proxy_cookie_domain 127.0.0.1 appwrite.lostcausenetwork.com;
  65. proxy_cookie_path / /;
  66.  
  67. proxy_buffering off;
  68. proxy_request_buffering off;
  69. proxy_read_timeout 86400;
  70. proxy_send_timeout 600;
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment