Skip to content

Instantly share code, notes, and snippets.

@terenceponce terenceponce/default.conf
Last active Aug 29, 2015

Embed
What would you like to do?
Typical Rails nginx configuration
upstream zealous-badger {
server 127.0.0.1:49224;
}
server {
listen [::]:80;
listen 80;
server_name zealous-badger.example.com;
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/mydomain.com/current/public;
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
You can’t perform that action at this time.