nginx.conf.template 756 B

12345678910111213141516171819202122232425
  1. server {
  2. listen 80;
  3. root /usr/share/nginx/html;
  4. index index.html;
  5. location / {
  6. try_files $uri $uri/ /index.html;
  7. }
  8. # SSO 回调页面:服务端重定向到 hash 路由格式
  9. # SSO平台不支持带#的redirect_uri,所以需要nginx将 /auth/callback?code=xxx
  10. # 重定向到 /#/auth/callback?code=xxx
  11. location = /auth/callback {
  12. return 302 /#/auth/callback$is_args$args;
  13. }
  14. location ~ ^/(v1|v2|auth|version|proxy|update|cli|grafana) {
  15. proxy_pass ${BACKEND_URL};
  16. proxy_set_header Host $host;
  17. proxy_set_header X-Real-IP $remote_addr;
  18. proxy_http_version 1.1;
  19. proxy_set_header Upgrade $http_upgrade;
  20. proxy_set_header Connection "upgrade";
  21. }
  22. }