grafana.conf 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. server {
  2. listen 80;
  3. server_name grafana.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. add_header 'Access-Control-Allow-Origin' '*';
  11. add_header 'Access-Control-Allow-Credentials' 'true';
  12. add_header Cache-Control private;
  13. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  14. 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';
  15. location / {
  16. if ($request_method = 'OPTIONS') {
  17. return 204;
  18. }
  19. proxy_pass http://grafana.observe.svc.cluster.local;
  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 /ping {
  25. return 200 'pong';
  26. }
  27. location /api/live/ws {
  28. add_header 'Access-Control-Allow-Origin' '*';
  29. add_header 'Access-Control-Allow-Credentials' 'true';
  30. add_header Cache-Control private;
  31. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
  32. 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';
  33. if ($request_method = 'OPTIONS') {
  34. return 204;
  35. }
  36. proxy_pass http://grafana.observe.svc.cluster.local;
  37. proxy_set_header X-Real-IP $remote_addr;
  38. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  39. proxy_set_header Host $host;
  40. proxy_set_header Upgrade $http_upgrade;
  41. proxy_set_header Connection $connection_upgrade;
  42. }
  43. }