Skip to content

Instantly share code, notes, and snippets.

@sj26
Last active August 30, 2023 19:10
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sj26/9885403 to your computer and use it in GitHub Desktop.
Save sj26/9885403 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;
}
}
}
@Tuurrre
Copy link

Tuurrre commented Jun 20, 2017

This worked nicely, thanks!

@matymad
Copy link

matymad commented Aug 7, 2018

Wonderful

@rajeshisnepali
Copy link

No Dice

The message you were looking for does not exist, or doesn't have content of this type.

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