default.conf.bak 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. server {
  2. listen 80;
  3. server_name _;
  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. add_header 'Access-Control-Allow-Origin' 'http://localhost:5678';
  11. # add_header 'Access-Control-Allow-Origin' 'http://msa.js.sgcc.com.cn:6001';
  12. add_header 'Access-Control-Allow-Credentials' 'true';
  13. # add_header Cache-Control private;
  14. add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS';
  15. add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Referer,Referrer-Policy';
  16. add_header 'Access-Control-Max-Age' '1728000';
  17. location / {
  18. if ($request_method = 'OPTIONS') {
  19. # add_header 'Content-Type' 'text/plain charset=UTF-8';
  20. # add_header 'Content-Length' '0';
  21. return 204;
  22. }
  23. proxy_pass http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4318;
  24. proxy_set_header Host $host;
  25. proxy_set_header X-Real-IP $remote_addr;
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. }
  28. }