nginx.conf 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #user nobody;
  2. worker_processes 1;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. #pid logs/nginx.pid;
  7. events {
  8. worker_connections 1024;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. sendfile on;
  14. proxy_buffer_size 128k;
  15. proxy_buffers 32 128k;
  16. proxy_busy_buffers_size 128k;
  17. keepalive_timeout 65;
  18. server {
  19. listen 81;
  20. server_name localhost;#修改为host
  21. location /Bug {
  22. proxy_pass http://127.0.0.1:8091;
  23. }
  24. location ^~ /dashboard/ {
  25. proxy_pass http://localhost:6666;
  26. }
  27. location ^~ /static/ {
  28. proxy_pass http://localhost:6666;
  29. }
  30. location /QC {
  31. proxy_pass http://127.0.0.1:8080;
  32. }
  33. location ^~ /document/ {
  34. alias /back_end/document/; # 文件存放目录,注意要以 '/' 结尾;
  35. index index.html; # 如果文件存放目录有 index.html,会跳转到 index.html;
  36. autoindex on; # 自动列出目录下的文件;
  37. autoindex_exact_size off; # 文件大小按 G、M 的格式显示,而不是 Bytes;
  38. }
  39. location ^~ /resourceXinchuang/ {
  40. alias /Users/hannatao/Downloads/; # 文件存放目录,注意要以 '/' 结尾;
  41. index index.html; # 如果文件存放目录有 index.html,会跳转到 index.html;
  42. autoindex on; # 自动列出目录下的文件;
  43. autoindex_exact_size off; # 文件大小按 G、M 的格式显示,而不是 Bytes;
  44. }
  45. location / {
  46. proxy_pass http://localhost:5555;
  47. #return 404;
  48. }
  49. }
  50. server {
  51. listen 5555;
  52. server_name localhost;
  53. location / {
  54. root /front_end/prod/;
  55. index index.html;
  56. try_files $uri $uri/ /index.html;
  57. }
  58. }
  59. server {
  60. listen 6666;
  61. server_name localhost;
  62. location / {
  63. root /databoard/dist/;
  64. index index.html;
  65. try_files $uri $uri/ /index.html;
  66. }
  67. }
  68. }