Advertisement
Guest User

Nginx Site Deny Access Folder by IP

a guest
Sep 29th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. location / {
  2. try_files $uri $uri/ /index.php$is_args$args;
  3. }
  4.     
  5. location ~ \.php$ {
  6. # Zero-day exploit defense.
  7. # http://forum.nginx.org/read.php?2,88845,page=3
  8. # Won't work properly (404 error) if the file is not stored on
  9. # this server, which is entirely possible with php-fpm/php-fcgi.
  10. # Comment the 'try_files' line out if you set up php-fpm/php-fcgi
  11. # on another machine. And then cross your fingers that you won't get hacked.
  12. try_files $uri =404;
  13.  
  14. include fastcgi_params;
  15.  
  16. # Keep these parameters for compatibility with old PHP scripts using them.
  17. fastcgi_param PATH_INFO $fastcgi_path_info;
  18. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
  19. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  20.  
  21. # Some default config
  22. fastcgi_connect_timeout 20;
  23. fastcgi_send_timeout 180;
  24. fastcgi_read_timeout 180;
  25. fastcgi_buffer_size 128k;
  26. fastcgi_buffers 4 256k;
  27. fastcgi_busy_buffers_size 256k;
  28. fastcgi_temp_file_write_size 256k;
  29. fastcgi_intercept_errors on;
  30. fastcgi_ignore_client_abort off;
  31. fastcgi_pass 127.0.0.1:9000;
  32.  
  33. }
  34.     
  35. location ~ ^/info {
  36. allow 192.168.1.88/32;
  37. deny all;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement