domain.conf 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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/jiaoyoucms/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. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  32. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  33. # With php-cgi alone:
  34. fastcgi_pass web-php7:9000;
  35. #fastcgi_pass onepage-php5:9000;
  36. # With php-fpm:
  37. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  38. fastcgi_index index.php;
  39. fastcgi_param SCRIPT_FILENAME $rootdir/index.php;
  40. fastcgi_param PATH_INFO $fastcgi_path_info;
  41. include fastcgi_params;
  42. }
  43. }