-
-
Save huglester/440112f66de3a1e39f56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream mailcatcher { | |
sticky; | |
server appserver.domain.ch:3000 max_fails=1 fail_timeout=2s; | |
} | |
server { | |
listen 80; | |
server_name mailcatcher.domain.ch; | |
client_max_body_size 4G; | |
keepalive_timeout 5; | |
# Websocket messages | |
location /messages { | |
proxy_set_header Host $http_host; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
if ($host !~ 'mailcatcher.domain.ch') { | |
return 404; | |
} | |
proxy_pass http://mailcatcher; | |
break; | |
} | |
location / { | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
if ($host !~ 'mailcatcher.domain.ch') { | |
return 404; | |
} | |
if (-f /root/mailcatcher/.maintenance) { | |
return 599; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://mailcatcher; | |
break; | |
} | |
} | |
include /etc/nginx/static/status.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment