Guest User

Untitled

a guest
Jan 23rd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. server {
  2. listen 80;
  3. access_log /path/to/site/logs/access.log combined buffer=256k flush=600m;
  4. error_log /path/to/site/logs/error.log warn;
  5. root /path/to/site/httpdocs/;
  6. index index.php index.html index.htm;
  7.  
  8. #-- Deny Ips
  9. location / {
  10. include denyips.conf;
  11. try_files $uri $uri/ =404;
  12. }
  13.  
  14. #-- Error Pages
  15. error_page 404 /404.html;
  16. error_page 500 502 503 504 /index.php;
  17. location = /50x.html {
  18. root /usr/local/nginx/html;
  19. }
  20.  
  21. #-- Folder with php7.0
  22. location ~ /one/two/three/ {
  23. try_files $uri $uri/ index.php?$query_string;
  24.  
  25. location ~ .php$ {
  26. fastcgi_pass unix:/run/php/php7.2-fpm.sock;
  27. fastcgi_index index.php;
  28. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  29. include fastcgi_params;
  30. }
  31.  
  32. #-- Main website
  33. location ~ .php$ {
  34. include denyips.conf;
  35. try_files $uri =404;
  36. fastcgi_split_path_info ^(.+.php)(/.+)$;
  37.  
  38. # With php5.6-fpm:
  39. fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
  40.  
  41. fastcgi_param HTTPS on;
  42. fastcgi_index index.php;
  43. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  44. include fastcgi_params;
  45. }
  46.  
  47. location ~* (.ht|.bak|.off|.config|.sql|.fla|.psd|.ini|.log|.sh|.inc|.swp|.dist)$ {
  48. deny all;
  49. }
  50. }
  51.  
  52. try_files $uri $uri/ /one/two/three/index.php$is_args$args;
Add Comment
Please, Sign In to add comment