From d88056b4f99afe1aa8375b87550dc5ae41b8a864 Mon Sep 17 00:00:00 2001 From: David Rotermund Date: Sun, 21 Jul 2024 02:35:55 +0200 Subject: [PATCH] Update nginx.conf --- overleafnginx/nginx.conf | 117 ++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 38 deletions(-) diff --git a/overleafnginx/nginx.conf b/overleafnginx/nginx.conf index b9e0977..b6d3271 100644 --- a/overleafnginx/nginx.conf +++ b/overleafnginx/nginx.conf @@ -1,43 +1,84 @@ events {} http { - server { - listen 80 default_server; - server_name _; - return 301 https://$host$request_uri; - } - server { - listen 443 ssl; - ssl_certificate /certs/nginx_certificate.pem; - ssl_certificate_key /certs/nginx_key.pem; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_prefer_server_ciphers on; - ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; - add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; - server_tokens off; - client_max_body_size 50M; + server { + listen 80 default_server; + server_name _; + return 301 https://$host$request_uri; + } - location / { - proxy_pass http://overleafserver:80; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 3m; - proxy_send_timeout 3m; - } + server { + listen 443 ssl; + ssl_certificate /certs/nginx_certificate.pem; + ssl_certificate_key /certs/nginx_key.pem; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_prefer_server_ciphers on; + ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; + add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;"; + server_tokens off; + client_max_body_size 50M; - location /register { - proxy_pass http://overleafpython:80; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 3m; - proxy_send_timeout 3m; - } - } + location / { + proxy_pass http://overleafserver:80; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 3m; + proxy_send_timeout 3m; + } + + location /register { + proxy_pass http://overleafregister:80; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 3m; + proxy_send_timeout 3m; + } + + location /articles { + proxy_pass https://www.overleaf.com; + proxy_set_header Host www.overleaf.com; + proxy_ssl_verify off; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 3m; + proxy_send_timeout 3m; + } + + location /templates { + proxy_pass https://www.overleaf.com; + proxy_set_header Host www.overleaf.com; + proxy_ssl_verify off; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 3m; + proxy_send_timeout 3m; + } + + location /latex/templates { + proxy_pass https://www.overleaf.com; + proxy_set_header Host www.overleaf.com; + proxy_ssl_verify off; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 3m; + proxy_send_timeout 3m; + } + } } +