Advertisement
sandyd

nginx

Jul 13th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. server {
  2.  
  3. #replace <your_ip_here> with your ip address.
  4. listen <your_ip_here>:80; ## listen for ipv4; this line is default and implied
  5. #listen [::]:80 default ipv6only=on; ## listen for ipv6
  6.  
  7. #location of your files
  8. root /srv;
  9. index index.html index.htm;
  10.  
  11. # The name of your domain (virtual hosts)
  12. server_name localhost;
  13.  
  14. location / {
  15. # First attempt to serve request as file, then
  16. # as directory, then fall back to index.html
  17. try_files $uri $uri/ /index.html /index.php;
  18. # Uncomment to enable naxsi on this location
  19. #include /etc/nginx/naxsi.rules;
  20. #autoindex on;
  21. }
  22.  
  23. # Only for nginx-naxsi : process denied requests
  24. #location /RequestDenied {
  25. # # For example, return an error code
  26. # return 418;
  27. #}
  28.  
  29. #error_page 404 /404.html;
  30.  
  31. # redirect server error pages to the static page /50x.html
  32. #
  33. #error_page 500 502 503 504 /50x.html;
  34. #location = /50x.html {
  35. # root /usr/share/nginx/www;
  36. #}
  37.  
  38. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  39. #
  40. location ~ \.php$ {
  41. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  42. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  43.  
  44. # With php5-cgi alone:
  45. # fastcgi_pass 127.0.0.1:9000;
  46. # With php5-fpm:
  47. fastcgi_pass unix:/var/run/php5-fpm.sock;
  48. fastcgi_index index.php;
  49. include fastcgi_params;
  50. }
  51.  
  52. # deny access to .htaccess files, if Apache's document root
  53. # concurs with nginx's one
  54. #
  55. location ~ /\.ht {
  56. deny all;
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement