Skip to content

Instantly share code, notes, and snippets.

@candidosales
Created February 7, 2013 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save candidosales/4733904 to your computer and use it in GitHub Desktop.
Save candidosales/4733904 to your computer and use it in GitHub Desktop.
upstream midiaexterna {
server unix:///home/ubuntu/midiaexterna/current/tmp/puma.sock;
}
server {
listen 80;
server_name 177.71.250.61;
keepalive_timeout 5;
root /home/ubuntu/midiaexterna/current/public;
access_log /home/ubuntu/log/nginx/nginx.access.log;
error_log /home/ubuntu/log/nginx/nginx.error.log info;
if (-f $document_root/maintenance.html) {
rewrite ^(.*)$ /maintenance.html last;
break;
}
location ~ ^/(assets)/ {
root /home/ubuntu/midiaexterna/current/public;
expires max;
add_header Cache-Control public;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
if (-f $request_filename) {
break;
}
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://177.71.250.61;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment