Skip to content

Instantly share code, notes, and snippets.

@logsol
Created January 8, 2014 16:46
Show Gist options
  • Save logsol/8319923 to your computer and use it in GitHub Desktop.
Save logsol/8319923 to your computer and use it in GitHub Desktop.
local nginx configuration with magic context routing - running php-fpm on 9000
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name ~^(?<project>[^.]+)\.local$;
root /Users/logsol/Work/projects/www/${project}/;
index index.html index.htm index.php;
error_log /Users/logsol/Work/projects/www/error.log;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~ .php$ {
include /usr/local/etc/nginx/fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment