Skip to content

Instantly share code, notes, and snippets.

@kidpollo
Created April 8, 2017 08:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidpollo/5cfe55d43dad9230b2fe3ffcea92807b to your computer and use it in GitHub Desktop.
Save kidpollo/5cfe55d43dad9230b2fe3ffcea92807b to your computer and use it in GitHub Desktop.
Simple nginx ssl proxy configiration for local development
# do https://gist.github.com/jed/6147872 and then do this to proxy your app
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name foo.local;
ssl_certificate ssl.crt;
ssl_certificate_key ssl.key;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log nginx.access.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 90;
proxy_redirect http://127.0.0.1:8080 https://foo.local;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment