Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- access_log /path/to/site/logs/access.log combined buffer=256k flush=600m;
- error_log /path/to/site/logs/error.log warn;
- root /path/to/site/httpdocs/;
- index index.php index.html index.htm;
- #-- Deny Ips
- location / {
- include denyips.conf;
- try_files $uri $uri/ =404;
- }
- #-- Error Pages
- error_page 404 /404.html;
- error_page 500 502 503 504 /index.php;
- location = /50x.html {
- root /usr/local/nginx/html;
- }
- #-- Folder with php7.0
- location ~ /one/two/three/ {
- try_files $uri $uri/ index.php?$query_string;
- location ~ .php$ {
- fastcgi_pass unix:/run/php/php7.2-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- #-- Main website
- location ~ .php$ {
- include denyips.conf;
- try_files $uri =404;
- fastcgi_split_path_info ^(.+.php)(/.+)$;
- # With php5.6-fpm:
- fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
- fastcgi_param HTTPS on;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- location ~* (.ht|.bak|.off|.config|.sql|.fla|.psd|.ini|.log|.sh|.inc|.swp|.dist)$ {
- deny all;
- }
- }
- try_files $uri $uri/ /one/two/three/index.php$is_args$args;
Add Comment
Please, Sign In to add comment