Skip to content

Instantly share code, notes, and snippets.

@kuleszaj
Created February 25, 2012 21:53
Show Gist options
  • Save kuleszaj/1911050 to your computer and use it in GitHub Desktop.
Save kuleszaj/1911050 to your computer and use it in GitHub Desktop.
Nginx with X-Forwarded-Proto set for SSL
server {
listen 1.2.3.4:443;
server_name railsapp.example.com;
ssl on;
ssl_certificate cert.pem;
ssl_certificate_key cert.key;
location / {
proxy_set_header X-Forwarded-Proto https;
# Sets the HTTP headers appropiately;
proxy_pass http://rails_application;
}
}
@jamallmahmoudi
Copy link

proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Scheme https;

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