default.conf 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. client_max_body_size 8M;
  11. }
  12. location ~* \.(db3|json)$ {
  13. deny all;
  14. }
  15. location ~* ^/(temp|upload|imgs|data|application|static|system)/.*.(php|php5)$ {
  16. return 403;
  17. }
  18. #error_page 404 /404.html;
  19. # redirect server error pages to the static page /50x.html
  20. #
  21. error_page 500 502 503 504 /50x.html;
  22. location = /50x.html {
  23. root /usr/share/nginx/html;
  24. }
  25. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  26. #
  27. #location ~ \.php$ {
  28. # proxy_pass http://127.0.0.1;
  29. #}
  30. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  31. #
  32. location ~ \.php$ {
  33. root /usr/share/nginx/html;
  34. fastcgi_pass 127.0.0.1:9000;
  35. fastcgi_index index.php;
  36. fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
  37. include fastcgi_params;
  38. }
  39. # deny access to .htaccess files, if Apache's document root
  40. # concurs with nginx's one
  41. #
  42. #location ~ /\.ht {
  43. # deny all;
  44. #}
  45. }