Skip to content

Instantly share code, notes, and snippets.

@AlexRogalskiy
Forked from DamonOehlman/default.conf
Created June 12, 2022 08:10
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 AlexRogalskiy/cb9845358698b180082a1e76fd5a49a9 to your computer and use it in GitHub Desktop.
Save AlexRogalskiy/cb9845358698b180082a1e76fd5a49a9 to your computer and use it in GitHub Desktop.
Simple nginx configuration for proxying HTTPS traffic to a local port
server {
listen 443;
server_name localhost;
root html;
index index.html index.htm;
ssl on;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
location ~ ^/(?<fwdport>\d+)/(?<fwdpath>.*)$ {
proxy_pass http://127.0.0.1:$fwdport/$fwdpath;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
# the following request would be directed to http://localhost:8000/index.html
curl https://localhost/8000/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment