site.conf 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. server {
  2. server_name localhost;
  3. listen 80;
  4. autoindex on;
  5. set $charset utf-8;
  6. charset $charset;
  7. set $rootdir /www;
  8. root $rootdir;
  9. index index.php index.html;
  10. location / {
  11. # First attempt to serve request as file, then
  12. # as directory, then fall back to displaying a 404.
  13. try_files $uri $uri/ =404;
  14. # Uncomment to enable naxsi on this location
  15. # include /etc/nginx/naxsi.rules
  16. }
  17. location ~ \.php$ {
  18. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  19. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  20. # With php5-cgi alone:
  21. fastcgi_pass web-php:9000;
  22. # With php5-fpm:
  23. #fastcgi_pass unix:/var/run/php5-fpm.sock;
  24. fastcgi_index index.php;
  25. fastcgi_param SCRIPT_FILENAME $rootdir/$fastcgi_script_name;
  26. include fastcgi_params;
  27. }
  28. }
  29. server {
  30. server_name wx.shemic.com;
  31. listen 80; # 或者 443,如果你使用 HTTPS 的话
  32. # ssl on; 是否启用加密连接
  33. # 如果你使用 HTTPS,还需要填写 ssl_certificate 和 ssl_certificate_key
  34. location / { # 如果你希望通过子路径访问,此处修改为子路径,注意以 / 开头并以 / 结束
  35. proxy_pass http://wx.shemic.com:5000/;
  36. }
  37. }