Advertisement
Guest User

Untitled

a guest
Dec 29th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. test
  2. - data.db
  3. - page.php
  4. - .htpasswd
  5. index.html
  6. index.php
  7. .htpasswd
  8.  
  9. server {
  10. #listen 80; ## listen for ipv4; this line is default and implied
  11. #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
  12.  
  13. root /usr/share/nginx/www;
  14. index index.html index.htm index.php;
  15.  
  16. # Make site accessible from http://localhost/
  17. server_name localhost;
  18.  
  19. location / {
  20. # First attempt to serve request as file, then
  21. # as directory, then fall back to displaying a 404.
  22. try_files $uri $uri/ /index.html;
  23. # Uncomment to enable naxsi on this location
  24. # include /etc/nginx/naxsi.rules
  25. }
  26.  
  27. location /doc/ {
  28. alias /usr/share/doc/;
  29. autoindex on;
  30. allow 127.0.0.1;
  31. allow ::1;
  32. deny all;
  33. }
  34.  
  35. #pass the PHP scripts to PHP-FPM server listening on unix socket
  36. location ~ .php$ {
  37. try_files $uri =404;
  38. fastcgi_split_path_info ^(.+.php)(/.+)$;
  39. fastcgi_pass unix:/var/run/php5-fpm.sock;
  40. fastcgi_index index.php;
  41. include fastcgi_params;
  42. }
  43.  
  44. location ~ /testDb {
  45. auth_basic "Admin Login";
  46. auth_basic_user_file /usr/share/nginx/www/test/.htpasswd;
  47. }
  48.  
  49. # deny access to .ht files
  50. location ~ .ht {
  51. deny all;
  52. }
  53.  
  54. # deny access to .db files
  55. location ~ .db {
  56. deny all;
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement