default.nginxconf 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. server {
  2. listen 80 default_server;
  3. listen [::]:80 default_server;
  4. # SSL configuration
  5. #
  6. # listen 443 ssl default_server;
  7. # listen [::]:443 ssl default_server;
  8. #
  9. # Note: You should disable gzip for SSL traffic.
  10. # See: https://bugs.debian.org/773332
  11. #
  12. # Read up on ssl_ciphers to ensure a secure configuration.
  13. # See: https://bugs.debian.org/765782
  14. #
  15. # Self signed certs generated by the ssl-cert package
  16. # Don't use them in a production server!
  17. #
  18. # include snippets/snakeoil.conf;
  19. root /var/www/html;
  20. # Add index.php to the list if you are using PHP
  21. index index.html index.htm index.nginx-debian.html index.php;
  22. server_name _;
  23. location / {
  24. # First attempt to serve request as file, then
  25. # as directory, then fall back to displaying a 404.
  26. try_files $uri $uri/ =404;
  27. }
  28. # pass PHP scripts to FastCGI server
  29. location ~ \.php$ {
  30. fastcgi_pass 127.0.0.1:9000;
  31. fastcgi_index index.php;
  32. include fastcgi.conf;
  33. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  34. }
  35. # deny access to .htaccess files, if Apache's document root
  36. # concurs with nginx's one
  37. location ~ /\.ht {
  38. deny all;
  39. }
  40. ## Images and static content is treated different
  41. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  42. access_log off;
  43. expires max;
  44. }
  45. location ~ /(libraries|setup/frames|setup/libs) {
  46. deny all;
  47. return 404;
  48. }
  49. location /nginx_status {
  50. stub_status on;
  51. access_log off;
  52. allow 127.0.0.1;
  53. # allow CURRENT-SERVER-IP;
  54. deny all;
  55. }
  56. }