Skip to content

Instantly share code, notes, and snippets.

@fr34k8
Forked from robertlemke/nginx.conf
Last active August 29, 2015 14:10
Show Gist options
  • Save fr34k8/23ec0ec2f3944d16adbe to your computer and use it in GitHub Desktop.
Save fr34k8/23ec0ec2f3944d16adbe to your computer and use it in GitHub Desktop.
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
root /Users/robert/Sites;
server {
listen 80;
server_name localhost;
location / {
index index.php index.html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_index index.php;
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
server {
listen 80;
server_name ~^(?<project>.*)\.dev$;
root /Users/robert/Sites/$project/Web;
client_max_body_size 50M;
index index.php;
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param FLOW_CONTEXT Development;
fastcgi_param FLOW_REWRITEURLS 1;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ "^/_Resources/Persistent/" {
rewrite "(.{40})/.+\.(.+)" /_Resources/Persistent/$1.$2 break;
rewrite "([a-z0-9]+/(.+/)?[a-f0-9]{40})/.+\.(.+)" /_Resources/Persistent/$1.$2 break;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires max;
}
}
server {
listen 80;
server_name ~^(?<project>.*)\.prod$;
root /Users/robert/Sites/$project/Web;
client_max_body_size 50M;
index index.php;
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param FLOW_CONTEXT Production;
fastcgi_param FLOW_REWRITEURLS 1;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ "^/_Resources/Persistent/" {
rewrite "(.{40})/.+\.(.+)" /_Resources/Persistent/$1.$2 break;
rewrite "([a-z0-9]+/(.+/)?[a-f0-9]{40})/.+\.(.+)" /_Resources/Persistent/$1.$2 break;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires max;
}
}
server {
listen 80;
server_name ~^(?<project>.*)\.l$;
root /Users/robert/Sites/$project;
client_max_body_size 50M;
index index.php;
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires max;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment