site.conf 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. if ( $request_uri ~* /system/wechat ) {
  20. rewrite ^/system/wechat /system/index.php?m=payment&a=wechat_notify last;
  21. }
  22. if ( $request_uri ~* /grow/pay/notify ) {
  23. rewrite ^/grow/pay/notify/([0-9+]) /grow/pay/index.php?l=api.notify&account_id=$1 last;
  24. }
  25. location / {
  26. # First attempt to serve request as file, then
  27. # as directory, then fall back to displaying a 404.
  28. try_files $uri $uri/ =404;
  29. # Uncomment to enable naxsi on this location
  30. # include /etc/nginx/naxsi.rules
  31. }
  32. #location ~ ^(.*)$ {
  33. location ~ \.php$ {
  34. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  35. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini (No settings!)
  36. # With php-cgi alone:
  37. fastcgi_pass web-php7:9000;
  38. #fastcgi_pass web-php5:9000;
  39. # With php-fpm:
  40. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  41. fastcgi_index index.php;
  42. fastcgi_param SCRIPT_FILENAME $rootdir/$fastcgi_script_name;
  43. #fastcgi_param PATH_INFO $fastcgi_path_info;
  44. include fastcgi_params;
  45. }
  46. }
  47. #server {
  48. #server_name wx.shemic.com;
  49. #listen 80; # 或者 443,如果你使用 HTTPS 的话
  50. #ssl on; 是否启用加密连接
  51. #如果你使用 HTTPS,还需要填写 ssl_certificate 和 ssl_certificate_key
  52. #location / { # 如果你希望通过子路径访问,此处修改为子路径,注意以 / 开头并以 / 结束
  53. #proxy_pass http://wx.shemic.com:5000/;
  54. #}
  55. #}