Advertisement
acieslak

nginx config for sf_blog

Apr 25th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.71 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.         server_name www.sf-blog.pl.127.0.0.1.xip.io;
  4.         root /Users/adriancieslak/Sites/sf_blog/web;
  5.         index app_dev.php;
  6.  
  7.         location / {
  8.             # try to serve file directly, fallback to app.php
  9.             try_files $uri /app.php$is_args$args;
  10.         }
  11.  
  12.         # DEV
  13.         # This rule should only be placed on your development environment
  14.         # In production, don't include this and don't deploy app_dev.php or config.php
  15.         location ~ ^/(app_dev|config)\.php(/|$) {
  16.             fastcgi_pass backend_php;
  17.             fastcgi_split_path_info ^(.+\.php)(/.*)$;
  18.             include fastcgi_params;
  19.             # When you are using symlinks to link the document root to the
  20.             # current version of your application, you should pass the real
  21.             # application path instead of the path to the symlink to PHP
  22.             # FPM.
  23.             # Otherwise, PHP's OPcache may not properly detect changes to
  24.             # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  25.             # for more information).
  26.             fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  27.             fastcgi_param DOCUMENT_ROOT $realpath_root;
  28.         }
  29.  
  30.         location ~ $ {
  31.             try_files $uri $uri/ /app_dev.php?$query_string;
  32.         }
  33.  
  34.         # return 404 for all other php files not matching the front controller
  35.         # this prevents access to other php files you don't want to be accessible.
  36.         location ~ \.php$ {
  37.             return 404;
  38.         }
  39.  
  40.         access_log /opt/local/var/log/nginx/sf-blog-access.log;
  41.         error_log  /opt/local/var/log/nginx/sf-blog-error.log error;
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement