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; }