obf.conf 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. server {
  2. listen 80;
  3. server_name observe-front.cestong.com.cn ui.test.obs.js.sgcc.com.cn ui.obs.js.sgcc.com.cn;
  4. server_tokens off;
  5. error_page 404 /404.html;
  6. location = /404.html {
  7. root /usr/share/nginx/html;
  8. internal;
  9. }
  10. #charset koi8-r;
  11. #access_log /var/log/nginx/host.access.log main;
  12. #add_header 'Access-Control-Allow-Origin' '*';
  13. #add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS';
  14. #add_header 'Access-Control-Allow-Headers' '*';
  15. #add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
  16. location / {
  17. proxy_pass http://obf.observe.svc.cluster.local:80;
  18. proxy_set_header Host $host;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. }
  22. location /col {
  23. add_header 'Access-Control-Allow-Origin' $allow_origin;
  24. add_header 'Access-Control-Allow-Credentials' 'true';
  25. add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS';
  26. 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';
  27. add_header 'Access-Control-Max-Age' '1728000';
  28. if ($request_method = 'OPTIONS') {
  29. return 204;
  30. }
  31. proxy_pass http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4318;
  32. proxy_set_header X-Real-IP $remote_addr;
  33. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  34. proxy_set_header Host $host;
  35. rewrite ^/col/(.*)$ /$1 break;
  36. }
  37. location /ui {
  38. add_header 'Access-Control-Allow-Origin' '*';
  39. add_header 'Access-Control-Allow-Credentials' 'true';
  40. add_header Cache-Control private;
  41. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  42. 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';
  43. if ($request_method = 'OPTIONS') {
  44. return 204;
  45. }
  46. proxy_pass http://obui.observe.svc.cluster.local:80;
  47. rewrite ^/ui/(.*)$ /$1 break;
  48. proxy_set_header Host $host;
  49. proxy_set_header X-Real-IP $remote_addr;
  50. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  51. }
  52. location /re {
  53. if ($request_method = 'OPTIONS') {
  54. return 204;
  55. }
  56. proxy_pass http://ob-server.observe.svc.cluster.local;
  57. proxy_set_header X-Real-IP $remote_addr;
  58. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  59. proxy_set_header Host $host;
  60. rewrite ^/re/(.*)$ /$1 break;
  61. }
  62. location /core {
  63. add_header 'Access-Control-Allow-Origin' '*' always;
  64. add_header 'Access-Control-Allow-Credentials' 'true' always;
  65. add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS' always;
  66. 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, Authorization' always;
  67. add_header 'Access-Control-Max-Age' '1728000' always;
  68. if ($request_method = 'OPTIONS') {
  69. return 204;
  70. }
  71. proxy_pass http://ob-core.observe.svc.cluster.local;
  72. proxy_set_header X-Real-IP $remote_addr;
  73. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  74. proxy_set_header Host $host;
  75. rewrite ^/core/(.*)$ /$1 break;
  76. }
  77. location /api/v1/ws {
  78. add_header 'Access-Control-Allow-Origin' '*';
  79. add_header 'Access-Control-Allow-Credentials' 'true';
  80. add_header Cache-Control private;
  81. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  82. 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';
  83. if ($request_method = 'OPTIONS') {
  84. return 204;
  85. }
  86. proxy_pass http://ob-server.observe.svc.cluster.local;
  87. proxy_set_header X-Real-IP $remote_addr;
  88. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  89. proxy_set_header Host $host;
  90. proxy_set_header Upgrade $http_upgrade;
  91. proxy_set_header Connection $connection_upgrade;
  92. }
  93. location /app {
  94. if ($request_method = 'OPTIONS') {
  95. return 204;
  96. }
  97. proxy_pass http://deepflow-app.deepflow.svc.cluster.local:20418;
  98. proxy_set_header X-Real-IP $remote_addr;
  99. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  100. proxy_set_header Host $host;
  101. rewrite ^/app/(.*)$ /$1 break;
  102. }
  103. location /ui/api {
  104. if ($request_method = 'OPTIONS') {
  105. return 204;
  106. }
  107. return 202;
  108. }
  109. }