Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Typical Rails nginx configuration
upstream zealous-badger {
server {
listen [::]:80;
listen 80;
location / {
proxy_pass http://zealous-badger;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
location ~ ^/assets/ {
root /home/;
gzip_static on;
expires max;
add_header Cache-Control public;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment