domain.conf 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/video_api/public;
  8. root $rootdir;
  9. index index.php index.html;
  10. if (!-d $request_filename){
  11. set $rule_0 1$rule_0;
  12. }
  13. if (!-f $request_filename){
  14. set $rule_0 2$rule_0;
  15. }
  16. if ($rule_0 = "21"){
  17. rewrite ^/(.*)$ /index.php?s=$1 last;
  18. }
  19. location / {
  20. # First attempt to serve request as file, then
  21. # as directory, then fall back to displaying a 404.
  22. try_files $uri $uri/ =404;
  23. # Uncomment to enable naxsi on this location
  24. # include /etc/nginx/naxsi.rules
  25. }
  26. #location ~ ^(.*)$ {
  27. location ~ \.php$ {
  28. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  29. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini (No settings!)
  30. # With php-cgi alone:
  31. #fastcgi_pass web-php7_swoole:9000;
  32. fastcgi_pass web-php7:9000;
  33. #fastcgi_pass web-php5:9000;
  34. # With php-fpm:
  35. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  36. fastcgi_index index.php;
  37. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  38. #fastcgi_param PATH_INFO $fastcgi_path_info;
  39. include fastcgi_params;
  40. }
  41. }