Skip to content

Instantly share code, notes, and snippets.

@diago
Created November 16, 2011 21:58
Show Gist options
  • Save diago/1371590 to your computer and use it in GitHub Desktop.
Save diago/1371590 to your computer and use it in GitHub Desktop.
upstream portal {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
}
server {
listen 80 default_server;
server_name _;
root /opt/portal/public;
error_log /opt/comserve_portal/log/nginx_error.log;
access_log /opt/comserve_portal/log/nginx_access.log;
location / {
try_files $uri @portal;
}
location @portal {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://portal;
}
location ~* \.(jpg|png|gif)$ {
expires 30d;
}
location ~* \.(js|css) {
expires 7d;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment