plant.nginx.conf 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. server {
  2. server_name yubin.bid www.yubin.bid manage.yubin.bid forum.yubin.bid passport.yubin.bid upload.yubin.bid;
  3. listen 80;
  4. autoindex on;
  5. set $charset utf-8;
  6. charset $charset;
  7. set $rootdir /data/web/yubin.bid/web/application/plant;
  8. set $project www;
  9. if ( $host ~* "^([^\.]+)\.yubin\.bid" ) {
  10. set $project $1;
  11. }
  12. if ( $project ~* www ) {
  13. set $project main;
  14. }
  15. set $rewrite yes;
  16. if ( $request_uri ~* (assets\/|crossdomain\.xml) ) {
  17. set $rewrite no;
  18. set $rootdir /data/web/yubin.bid/web/package;
  19. }
  20. set $rootdir $rootdir/$project;
  21. root $rootdir;
  22. index index.php index.html;
  23. if ($rewrite ~* yes) {
  24. rewrite ^/(.*) /index.php/$1 last;
  25. }
  26. location ~ /(assets\/|crossdomain\.xml)
  27. {
  28. try_files $uri $uri/ /index.html;
  29. }
  30. location / {
  31. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  32. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  33. # With php5-cgi alone:
  34. #fastcgi_pass 127.0.0.1:9000;
  35. # With php5-fpm:
  36. fastcgi_pass unix:/var/run/php5-fpm.sock;
  37. fastcgi_index index.php;
  38. include fastcgi_params;
  39. }
  40. }
  41. server {
  42. server_name file.yubin.bid assets.yubin.bid;
  43. listen 80;
  44. autoindex on;
  45. set $charset utf-8;
  46. charset $charset;
  47. set $rootdir /data/web/yubin.bid/web/data;
  48. set $project upload;
  49. if ( $host ~* "^([^\.]+)\.yubin\.bid" ) {
  50. set $project $1;
  51. }
  52. if ( $project ~* file ) {
  53. set $project upload;
  54. }
  55. set $rootdir $rootdir/$project;
  56. root $rootdir;
  57. index index.html;
  58. location / {
  59. # First attempt to serve request as file, then
  60. # as directory, then fall back to displaying a 404.
  61. try_files $uri $uri/ =404;
  62. # Uncomment to enable naxsi on this location
  63. # include /etc/nginx/naxsi.rules
  64. }
  65. }