default.conf 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. #charset koi8-r;
  5. #access_log /var/log/nginx/host.access.log main;
  6. location / {
  7. root /usr/share/nginx/html;
  8. index index.php index.html index.htm ;
  9. try_files $uri $uri/ /index.php?$query_string;
  10. }
  11. location ~* \.(db3|json)$ {
  12. deny all;
  13. }
  14. location ~* ^/(temp|upload|imgs|data|application|static|system)/.*.(php|php5)$ {
  15. return 403;
  16. }
  17. #error_page 404 /404.html;
  18. # redirect server error pages to the static page /50x.html
  19. #
  20. error_page 500 502 503 504 /50x.html;
  21. location = /50x.html {
  22. root /usr/share/nginx/html;
  23. }
  24. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  25. #
  26. #location ~ \.php$ {
  27. # proxy_pass http://127.0.0.1;
  28. #}
  29. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  30. #
  31. location ~ \.php$ {
  32. root /usr/share/nginx/html;
  33. fastcgi_pass 127.0.0.1:9000;
  34. fastcgi_index index.php;
  35. fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
  36. include fastcgi_params;
  37. }
  38. # deny access to .htaccess files, if Apache's document root
  39. # concurs with nginx's one
  40. #
  41. #location ~ /\.ht {
  42. # deny all;
  43. #}
  44. }