Skip to content

Instantly share code, notes, and snippets.

@vl-ivanov
Forked from sj26/nginx.conf
Created September 17, 2017 00:11
Show Gist options
  • Select an option

  • Save vl-ivanov/8df70ca5bc8a9a93cdf6c1ade234f568 to your computer and use it in GitHub Desktop.

Select an option

Save vl-ivanov/8df70ca5bc8a9a93cdf6c1ade234f568 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