Skip to content

Instantly share code, notes, and snippets.

@cursedcoder
Created December 8, 2012 18:39
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 cursedcoder/4241267 to your computer and use it in GitHub Desktop.
Save cursedcoder/4241267 to your computer and use it in GitHub Desktop.
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 122048;
client_max_body_size 128M;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
server {
listen 80;
server_name localhost;
root /web;
index app_test.php;
# strip app.php/ prefix if it is present
rewrite ^/app_test\.php/?(.*)$ /$1 permanent;
location / {
index app_test.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app_test.php/$1 last;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9001
location ~ ^/(app|app_dev|app_test)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment