Skip to content

Instantly share code, notes, and snippets.

@ivan1911
Created November 21, 2013 17:52
Show Gist options
  • Save ivan1911/7586284 to your computer and use it in GitHub Desktop.
Save ivan1911/7586284 to your computer and use it in GitHub Desktop.
upstream phpfcgi {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name lostepisode.ru www.lostepisode.ru;
root /www/lostepisode.ru/web;
error_log /www/logs/lostepisode.ru/error.log;
access_log /www/logs/lostepisode.ru/access.log;
# strip app.php/ prefix if it is present
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass phpfcgi;
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