obui.conf 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. server {
  2. listen 80;
  3. server_name observe-ui.cestong.com.cn;
  4. #charset koi8-r;
  5. #access_log /var/log/nginx/host.access.log main;
  6. #add_header 'Access-Control-Allow-Origin' '*';
  7. #add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS';
  8. #add_header 'Access-Control-Allow-Headers' '*';
  9. #add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
  10. location / {
  11. add_header 'Access-Control-Allow-Origin' '*';
  12. add_header 'Access-Control-Allow-Credentials' 'true';
  13. add_header Cache-Control private;
  14. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  15. add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
  16. if ($request_method = 'OPTIONS') {
  17. return 204;
  18. }
  19. proxy_pass http://obui.observe.svc.cluster.local:80;
  20. proxy_set_header Host $host;
  21. proxy_set_header X-Real-IP $remote_addr;
  22. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23. }
  24. location /re {
  25. proxy_pass http://ob-server.observe.svc.cluster.local;
  26. rewrite ^/re/(.*)$ /$1 break;
  27. }
  28. }