You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

nginx.conf.bak0719 3.8 kB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include mime.types;
  7. default_type application/octet-stream;
  8. sendfile on;
  9. keepalive_timeout 65;
  10. client_max_body_size 20480m;
  11. error_log /var/log/nginx/error.log debug;
  12. server {
  13. listen 8000;
  14. server_name localhost;
  15. location /api/{
  16. # rewrite ^/prod-api/(.*)$ /$1 break;
  17. proxy_set_header Host $http_host;
  18. proxy_set_header X-Real-IP $remote_addr;
  19. proxy_set_header REMOTE-HOST $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_pass http://ci4s-gateway-service.argo.svc:8082/;
  22. proxy_connect_timeout 500s; # 设置连接超时时间为 120 秒
  23. proxy_read_timeout 500s; # 设置读取超时时间为 120 秒
  24. proxy_send_timeout 500s; # 设置发送超时时间为 120 秒
  25. }
  26. location /label-studio/ {
  27. # rewrite ^/label-studio/(.*)$ /$1 break;
  28. proxy_pass http://label-studio-service.argo.svc:8080/projects/;
  29. proxy_hide_header X-Frame-Options;
  30. add_header X-Frame-Options ALLOWALL;
  31. }
  32. location / {
  33. rewrite ^/prod-api/(.*)$ /$1 break;
  34. root /home/ruoyi/projects/ruoyi-ui;
  35. try_files $uri $uri/ /index.html;
  36. index index.html index.htm;
  37. }
  38. location /api/v1/model/ {
  39. proxy_pass http://pipeline-convert-service.argo.svc:80;
  40. proxy_set_header REMOTE-HOST $remote_addr;
  41. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  42. }
  43. # location /api/v1/realtimeStatus {
  44. # proxy_pass http://argo-server.argo.svc:2746/api/v1/workflow-events/argo;
  45. # proxy_set_header REMOTE-HOST $remote_addr;
  46. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47. # }
  48. location /api/v1/realtimeStatus {
  49. rewrite ^/api/v1/realtimeStatus(.*)$ /api/v1/workflow-events/argo$1 break;
  50. proxy_pass https://argo-server.argo.svc:2746;
  51. proxy_http_version 1.1;
  52. proxy_set_header Host $host;
  53. proxy_set_header REMOTE-HOST $remote_addr;
  54. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  55. proxy_set_header X-Forwarded-Proto $scheme;
  56. # 保留查询参数
  57. proxy_set_header X-Original-URI $request_uri;
  58. # 禁用缓冲
  59. proxy_buffering off;
  60. # 增加超时时间
  61. proxy_read_timeout 3600s;
  62. proxy_send_timeout 3600s;
  63. proxy_connect_timeout 60s;
  64. # 设置传递的请求头
  65. # proxy_set_header Connection '';
  66. # chunked_transfer_encoding off;
  67. # 如果需要保留自定义头部
  68. proxy_set_header Accept 'text/event-stream';
  69. }
  70. location /newlog/realtimeLog {
  71. proxy_pass http://loki.loki-log.svc:3100/loki/api/v1/tail;
  72. proxy_http_version 1.1;
  73. proxy_set_header Upgrade $http_upgrade;
  74. proxy_set_header Connection "Upgrade";
  75. proxy_set_header Host $host;
  76. proxy_set_header X-Real-IP $remote_addr;
  77. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  78. proxy_set_header X-Forwarded-Proto $scheme;
  79. }
  80. location @router {
  81. rewrite ^.*$ /index.html last;
  82. }
  83. # 避免actuator暴露
  84. if ($request_uri ~ "/actuator") {
  85. return 403;
  86. }
  87. error_page 500 502 503 504 /50x.html;
  88. location = /50x.html {
  89. root html;
  90. }
  91. }
  92. }