Skip to content

Instantly share code, notes, and snippets.

@tunglam14
Created September 8, 2013 16:35
Show Gist options
  • Save tunglam14/6486256 to your computer and use it in GitHub Desktop.
Save tunglam14/6486256 to your computer and use it in GitHub Desktop.
upstream app_name {
server unix:/usr/local/app_name/tmp/sockets/unicorn.sock;
}
server {
listen 80;
server_name localhost;
root /usr/local/app_name/public;
server_tokens off;
access_log /var/log/nginx/app_name_access.log;
error_log /var/log/nginx/app_name_error.log;
location / {
try_files $uri $uri/index.html $uri.html @app_name;
}
location @app_name {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://app_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment