Create a gist now

Instantly share code, notes, and snippets.

Nginx configuration for mailcatcher
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;
}
location /status {
stub_status on;
access_log off;
}
location /upstatus {
check_status;
access_log off;
}
@scottalan

What does your include /etc/nginx/static/status.conf; file look like?

@raskhadafi
Owner

Sorry for the delay! 😒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment