Skip to content

Instantly share code, notes, and snippets.

@forgotpw1
Forked from sj26/nginx.conf
Created January 19, 2018 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forgotpw1/18e10a31470df01eba20079b3507b79b to your computer and use it in GitHub Desktop.
Save forgotpw1/18e10a31470df01eba20079b3507b79b to your computer and use it in GitHub Desktop.
Proxy mailcatcher with nginx including WebSockets
daemon off;
error_log stderr;
events {
worker_connections 1024;
}
http {
# As suggested in http://nginx.org/en/docs/http/websocket.html
map $http_upgrade $connection_upgrade {
default upgrade;
"" close;
}
server {
listen 127.0.0.1:8080;
location / {
proxy_pass http://127.0.0.1:1080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment