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

31 lines
989 B

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: my.conf
  5. data:
  6. my.conf: |
  7. server {
  8. listen 8080;
  9. server_name localhost;
  10. #charset koi8-r;
  11. #access_log logs/host.access.log main;
  12. location / {
  13. root /usr/share/nginx/html;
  14. add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
  15. try_files $uri $uri/ /index.html;
  16. }
  17. location /api {
  18. proxy_set_header Host $http_host;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header X-Forwarded-Proto $scheme;
  22. rewrite ^/api/(.*)$ /$1 break; #重写
  23. proxy_pass http://gva-server:8888; # 设置代理服务器的协议和地址
  24. }
  25. location /api/swagger/index.html {
  26. proxy_pass http://gva-server:8888/swagger/index.html;
  27. }
  28. }