Skip to content

Instantly share code, notes, and snippets.

@papucho
Created August 3, 2013 16:41
Show Gist options
  • Save papucho/6147073 to your computer and use it in GitHub Desktop.
Save papucho/6147073 to your computer and use it in GitHub Desktop.
Nginx default conf
upstream my_app {
server unix:///tmp/my_app.sock;
}
server {
listen *:80;
server_name my_app.com;
access_log /var/log/nginx/my_app-access.log;
location /favicon.ico {
root /var/www/my_app/public/assets/favicon.ico;
gzip_static on;
expires max;
add_header Cache-Control public;
}
location / {
root /var/www/my_app/public;
try_files $uri @app;
gzip_static on;
expires max;
add_header Cache-Control public;
}
location @app {
proxy_pass http://my_app;
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 https;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_next_upstream error timeout invalid_header http_502;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment