Advertisement
jmedina

Nginx Config

Dec 26th, 2013
729
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. listen 80;
  3.  
  4. root /var/www;
  5. index index.php index.php index.htm;
  6.  
  7. server_name mydomain.com www.mydomain.com;
  8.  
  9. location / {
  10. try_files $uri $uri/ /index.php?q=$uri&$args;
  11. }
  12.  
  13. location ~ \.php$ {
  14. try_files $uri =404;
  15. fastcgi_pass unix:/var/run/php5-fpm.sock;
  16. fastcgi_index index.php;
  17. include fastcgi_params;
  18. }
  19.  
  20. location = /favicon.ico {
  21. log_not_found off;
  22. access_log off;
  23. }
  24.  
  25. location = /robots.txt {
  26. allow all;
  27. log_not_found off;
  28. access_log off;
  29. }
  30.  
  31. location ~ /\. {
  32. deny all;
  33. }
  34.  
  35. location ~* /(?:uploads|files)/.*\.php$ {
  36. deny all;
  37. }
  38. }
Advertisement
RAW Paste Data Copied
Advertisement