Skip to content

Instantly share code, notes, and snippets.

@RomanGorbatko
Created November 29, 2016 15:19
Show Gist options
  • Save RomanGorbatko/fa8c1e71f205b580a6f51acdf63358aa to your computer and use it in GitHub Desktop.
Save RomanGorbatko/fa8c1e71f205b580a6f51acdf63358aa to your computer and use it in GitHub Desktop.
upstream phpfcgi {
server 127.0.0.1:9000;
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server {
listen 80;
server_name procedure.zakupki-dev.online;
root /Users/rg/Devs/Sites/procedure/web/front;
#SF2 api routes
location ~* ^/(api|apidoc|openid|_profiler)(/|$) {
root /Users/rg/Devs/Sites/procedure/web;
index app_dev.php;
rewrite ^(.+)$ /app_dev.php/$1 last;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app_dev.php/$1 last;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app|app_dev|config)\.php(/|$) {
root /Users/rg/Devs/Sites/procedure/web;
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param PHP_VALUE "memory_limit = 512M";
}
#front
location / {
expires -1;
add_header Pragma "no-cache";
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
try_files $uri $uri/ /index.html =404;
}
error_log /var/log/nginx/procedure.isz.dev.error.log;
access_log /var/log/nginx/procedure.isz.dev.access.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment