qipai-manage.conf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. server {
  2. listen 80;
  3. server_name qipai-manage.*;
  4. charset utf-8;
  5. add_header Access-Control-Allow-Origin *;
  6. add_header Access-Control-Allow-Headers *;
  7. add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
  8. if ($request_method = 'OPTIONS') {
  9. return 204;
  10. }
  11. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  12. proxy_set_header Remote_addr $remote_addr;
  13. proxy_set_header X-Real_IP $remote_addr;
  14. proxy_set_header Host $host;
  15. proxy_set_header X-CROS true; # 自定义,有做跨域的时候需要加,后端会做判断
  16. proxy_redirect off;
  17. proxy_http_version 1.1;
  18. location / {
  19. root /usr/share/nginx/html/;
  20. try_files $uri $uri/ /index.html;
  21. index index.html;
  22. }
  23. location ^~ /qipai_manager_api/ {
  24. proxy_set_header Host $http_host;
  25. proxy_set_header X-Real-IP $remote_addr;
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. proxy_set_header X-Forwarded-Proto $scheme;
  28. # rewrite ^/qipai_manager_api/(.*)$ /$1 break; #重写
  29. proxy_pass http://qipai-manage-server-svc:8888/;
  30. }
  31. location ^~ /static/uploads/file {
  32. alias /home/wwwroot/cos/qipai_manager/uploads/file/;
  33. }
  34. location ^~ /static {
  35. #rewrite ^/static/(.*)$ /$1 break; #重写
  36. #proxy_pass http://cloudimg-xypp.xinyuepp.cn/;
  37. rewrite ^/(.*) http://cloudimg-xypp.xinyuepp.cn/$1 permanent;
  38. }
  39. location ^~ /assets/images {
  40. alias /data/images/;
  41. }
  42. }