default.conf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. server {
  2. listen 80;
  3. server_name _;
  4. server_tokens off;
  5. location = /404.html {
  6. root /usr/share/nginx/html;
  7. internal;
  8. }
  9. #charset koi8-r;
  10. #access_log /var/log/nginx/host.access.log main;
  11. #add_header 'Access-Control-Allow-Origin' '*';
  12. #add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS';
  13. #add_header 'Access-Control-Allow-Headers' '*';
  14. #add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
  15. # add_header 'Access-Control-Allow-Origin' 'http://localhost:5678';
  16. add_header 'Access-Control-Allow-Origin' 'http://msa.js.sgcc.com.cn:6001';
  17. add_header 'Access-Control-Allow-Credentials' 'true';
  18. # add_header Cache-Control private;
  19. add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS';
  20. 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';
  21. add_header 'Access-Control-Max-Age' '1728000';
  22. location / {
  23. if ($request_method = 'OPTIONS') {
  24. # add_header 'Content-Type' 'text/plain charset=UTF-8';
  25. # add_header 'Content-Length' '0';
  26. return 204;
  27. }
  28. proxy_pass http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4318;
  29. proxy_set_header Host $host;
  30. proxy_set_header X-Real-IP $remote_addr;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. }
  33. }