site.conf 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. server {
  2. server_name localhost;
  3. listen 80 default_server;
  4. autoindex on;
  5. set $charset utf-8;
  6. charset $charset;
  7. set $rootdir /www;
  8. if ( $request_uri ~* ^/(dever_package\/manage|dever_package\/ui|dever_package\/script) ) {
  9. set $rootdir /share/lib/php;
  10. }
  11. root $rootdir;
  12. index index.php index.html;
  13. if ( $request_uri ~* /(applet\/content|applet_on\/content) ) {
  14. rewrite ^/(.*)/content/(.*) /$1/content/index.php?$2 last;
  15. }
  16. if ( $request_uri ~* /log\/data.add ) {
  17. rewrite ^/log/(.*?) /log/index.php?$1 last;
  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/ =404;
  23. # Uncomment to enable naxsi on this location
  24. # include /etc/nginx/naxsi.rules
  25. }
  26. location ~ \.php$ {
  27. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  28. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  29. # With php-cgi alone:
  30. #fastcgi_pass web-php7:9000;
  31. fastcgi_pass onepage-php5:9000;
  32. # With php-fpm:
  33. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  34. fastcgi_index index.php;
  35. fastcgi_param SCRIPT_FILENAME $rootdir/$fastcgi_script_name;
  36. include fastcgi_params;
  37. }
  38. }
  39. #server {
  40. #server_name wx.shemic.com;
  41. #listen 80; # 或者 443,如果你使用 HTTPS 的话
  42. #ssl on; 是否启用加密连接
  43. #如果你使用 HTTPS,还需要填写 ssl_certificate 和 ssl_certificate_key
  44. #location / { # 如果你希望通过子路径访问,此处修改为子路径,注意以 / 开头并以 / 结束
  45. #proxy_pass http://wx.shemic.com:5000/;
  46. #}
  47. #}