From 7f8d7948350943220c67b8216b0c12a83cd3342b Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Fri, 20 Oct 2023 15:52:14 +0530 Subject: [PATCH] fix: sync nginx template from bench changes (#1241) --- resources/nginx-template.conf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/resources/nginx-template.conf b/resources/nginx-template.conf index 944bce3c..0568372a 100644 --- a/resources/nginx-template.conf +++ b/resources/nginx-template.conf @@ -42,8 +42,6 @@ server { location /socket.io { proxy_http_version 1.1; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER}; @@ -54,9 +52,9 @@ server { } location / { - rewrite ^(.+)/$ $proxy_x_forwarded_proto://${FRAPPE_SITE_NAME_HEADER}$1 permanent; - rewrite ^(.+)/index\.html$ $proxy_x_forwarded_proto://${FRAPPE_SITE_NAME_HEADER}$1 permanent; - rewrite ^(.+)\.html$ $proxy_x_forwarded_proto://${FRAPPE_SITE_NAME_HEADER}$1 permanent; + rewrite ^(.+)/$ $1 permanent; + rewrite ^(.+)/index\.html$ $1 permanent; + rewrite ^(.+)\.html$ $1 permanent; location ~ ^/files/.*.(htm|html|svg|xml) { add_header Content-disposition "attachment"; @@ -67,8 +65,9 @@ server { } location @webserver { - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Frappe-Site-Name ${FRAPPE_SITE_NAME_HEADER}; proxy_set_header Host $host; proxy_set_header X-Use-X-Accel-Redirect True;