vhost.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. server {
  2. listen 80;
  3. access_log /logs/access_nginx.log;
  4. error_log /logs/error_nginx.log;
  5. client_max_body_size 5M;
  6. root /www/server/public;
  7. index index.html index.htm index.php;
  8. location / {
  9. if (!-e $request_filename)
  10. {
  11. rewrite ^/(.*)$ /index.php?s=$1 last;
  12. break;
  13. }
  14. }
  15. location @router {
  16. rewrite ^.*$ /index.html last;
  17. }
  18. location ~ /.*\.php/ {
  19. rewrite ^(.*?/?)(.*\.php)(.*)$ /$2?s=$3 last;
  20. break;
  21. }
  22. location ^~ /platform {
  23. try_files $uri $uri/ @router;
  24. alias /www/platform/dist/;
  25. index index.html index.htm;
  26. }
  27. location ^~ /agent_admin {
  28. try_files $uri $uri/ @router;
  29. alias /www/agent_admin/dist/;
  30. index index.html index.htm;
  31. }
  32. location ^~ /admin {
  33. try_files $uri $uri/ @router;
  34. alias /www/admin/dist/;
  35. index index.html index.htm;
  36. }
  37. error_page 500 502 503 504 /50x.html;
  38. location = /50x.html {
  39. root /var/www/html;
  40. }
  41. location ~ \.php$ {
  42. fastcgi_pass php:9000;
  43. fastcgi_index index.php;
  44. fastcgi_param SCRIPT_FILENAME /www/server/public$fastcgi_script_name;
  45. include fastcgi_params;
  46. }
  47. location = /favicon.ico {
  48. log_not_found off;
  49. access_log off;
  50. }
  51. }