Advertisement
Guest User

Untitled

a guest
Sep 8th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.41 KB | None | 0 0
  1. server {
  2.     server_name reviews.local;
  3.     root /private/var/www/reviews/web;
  4.     client_max_body_size 32m;
  5.  
  6.     location / {
  7.         # try to serve file directly, fallback to app.php
  8.         try_files $uri /app_dev.php$is_args$args;
  9.     }
  10.     # DEV
  11.     # This rule should only be placed on your development environment
  12.     # In production, don't include this and don't deploy app_dev.php or config.php
  13.     location ~ ^/(app_dev|config)\.php(/|$) {
  14.         fastcgi_pass 127.0.0.1:9000;#unix:/var/run/php-fpm.sock;
  15.         fastcgi_split_path_info ^(.+\.php)(/.*)$;
  16.         include fastcgi_params;
  17.         # When you are using symlinks to link the document root to the
  18.         # current version of your application, you should pass the real
  19.         # application path instead of the path to the symlink to PHP
  20.         # FPM.
  21.         # Otherwise, PHP's OPcache may not properly detect changes to
  22.         # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  23.         # for more information).
  24.         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  25.         fastcgi_param DOCUMENT_ROOT $realpath_root;
  26.     }
  27.     # PROD
  28.     location ~ ^/app\.php(/|$) {
  29.         fastcgi_pass 127.0.0.1:9000;#unix:/var/run/php-fpm.sock;
  30.         fastcgi_split_path_info ^(.+\.php)(/.*)$;
  31.         include fastcgi_params;
  32.         # When you are using symlinks to link the document root to the
  33.         # current version of your application, you should pass the real
  34.         # application path instead of the path to the symlink to PHP
  35.         # FPM.
  36.         # Otherwise, PHP's OPcache may not properly detect changes to
  37.         # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  38.         # for more information).
  39.         fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  40.         fastcgi_param DOCUMENT_ROOT $realpath_root;
  41.         # Prevents URIs that include the front controller. This will 404:
  42.         # http://domain.tld/app.php/some-path
  43.         # Remove the internal directive to allow URIs like this
  44.         internal;
  45.     }
  46.  
  47.     # return 404 for all other php files not matching the front controller
  48.     # this prevents access to other php files you don't want to be accessible.
  49.     location ~ \.php$ {
  50.       return 404;
  51.     }
  52.  
  53.     error_log /usr/local/etc/nginx/logs/reviews_error.log;
  54.     access_log /usr/local/etc/nginx/logs/reviews_access.log;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement