From fe438e79c7f9c1fb6bc39e0ff55c7f160953de0c Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 8 Dec 2017 10:44:43 +0100 Subject: [PATCH] Simplify Sigmah and Motech proxy rules --- motech/etc/nginx/apps-available/motech | 18 +++++++++--------- sigmah/etc/nginx/apps-available/sigmah | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/motech/etc/nginx/apps-available/motech b/motech/etc/nginx/apps-available/motech index 0c98b6a..6afb3a4 100644 --- a/motech/etc/nginx/apps-available/motech +++ b/motech/etc/nginx/apps-available/motech @@ -1,11 +1,11 @@ location /motech { - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header Host $http_host; - proxy_set_header Proxy ""; - proxy_redirect off; - proxy_buffering off; - proxy_read_timeout 90; - proxy_connect_timeout 90; - proxy_pass http://127.0.0.1:9081/motech; + alias /srv/motech/webapps/motech; + try_files $uri @motech; +} + +location @motech { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Proto https; + proxy_pass http://127.0.0.1:9081; } diff --git a/sigmah/etc/nginx/apps-available/sigmah b/sigmah/etc/nginx/apps-available/sigmah index 8f3e84a..3143c25 100644 --- a/sigmah/etc/nginx/apps-available/sigmah +++ b/sigmah/etc/nginx/apps-available/sigmah @@ -1,11 +1,11 @@ location /sigmah { - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header Host $http_host; - proxy_set_header Proxy ""; - proxy_redirect off; - proxy_buffering off; - proxy_read_timeout 90; - proxy_connect_timeout 90; - proxy_pass http://127.0.0.1:9080/sigmah; + alias /srv/sigmah; + try_files $uri @sigmah; +} + +location @sigmah { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Proto https; + proxy_pass http://127.0.0.1:9080; }