Skip to content

Instantly share code, notes, and snippets.

@toomuchpete
Created May 20, 2013 20:02
Show Gist options
  • Save toomuchpete/5615044 to your computer and use it in GitHub Desktop.
Save toomuchpete/5615044 to your computer and use it in GitHub Desktop.
upstream unicorn {
server unix:/tmp/unicorn.sock:;
}
server {
listen 80;
server_name leagues.afdc.local;
root /var/www/leagues.afdc.com/;
access_log /var/log/leagues.afdc.com/access.log;
error_log /var/log/leagues.afdc.com/error.log warn;
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
location /users/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unix:/tmp/unicorn.sock:;
}
location /assets/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unix:/tmp/unicorn.sock:;
}
location ~ \.php$
{
fastcgi_pass php5-fpm-sock;
fastcgi_index index.php;
fastcgi_param PHP_VALUE "display_errors=on";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment