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