Advertisement
giO89R

ServerBlock Nginx

Oct 28th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4.  
  5. root /var/www/geekube;
  6. index index.php index.html index.htm;
  7.  
  8. server_name geekube.com www.geekube.com;
  9.  
  10. location / {
  11. try_files $uri $uri/ /index.php?q=$uri&$args;
  12. }
  13.  
  14. location ~ \.php$ {
  15. try_files $uri =404;
  16. fastcgi_pass unix:/var/run/php5-fpm.sock;
  17. fastcgi_index index.php;
  18. include fastcgi_params;
  19. }
  20.  
  21. location = /favicon.ico {
  22. log_not_found off;
  23. access_log off;
  24. }
  25.  
  26. location = /robots.txt {
  27. allow all;
  28. log_not_found off;
  29. access_log off;
  30. }
  31.  
  32. location ~ /\. {
  33. deny all;
  34. }
  35.  
  36. location ~* /(?:uploads|files)/.*\.php$ {
  37. deny all;
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement