domain.conf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. server {
  2. server_name me.5dev.cn;
  3. listen 80;
  4. autoindex on;
  5. set $charset utf-8;
  6. charset $charset;
  7. set $rootdir /www/jy/public;
  8. root $rootdir;
  9. index index.php index.html;
  10. set $rewrite yes;
  11. location ~ ^/favicon\.ico$ {
  12. root $rootdir;
  13. }
  14. location ~* (.*).tpl {
  15. return 404;
  16. }
  17. if ( $request_uri ~* ^/(doc\/|public\/|upload\/|assets\/|static\/|crossdomain\.xml|index\.php|favicon\.ico) ) {
  18. set $rewrite no;
  19. }
  20. if ($rewrite ~* yes) {
  21. rewrite ^/(.*) /index.php/$1 last;
  22. }
  23. location ~ /(doc\/|upload\/|public\/|assets\/|static\/|crossdomain\.xml)
  24. {
  25. try_files $uri $uri/ /index.html;
  26. }
  27. location /doc/ {
  28. try_files $uri $uri/ /index.html;
  29. }
  30. location ~ ^(.*)$ {
  31. #add_header Access-Control-Allow-Origin http://192.168.0.109:8080;
  32. #add_header Access-Control-Allow-Headers X-Requested-With;
  33. # add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
  34. #add_header Access-Control-Allow-Credentials true;
  35. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  36. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  37. # With php-cgi alone:
  38. fastcgi_pass web-php7:9000;
  39. #fastcgi_pass onepage-php5:9000;
  40. # With php-fpm:
  41. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  42. fastcgi_index index.php;
  43. fastcgi_param SCRIPT_FILENAME $rootdir/index.php;
  44. fastcgi_param PATH_INFO $fastcgi_path_info;
  45. include fastcgi_params;
  46. }
  47. }