Open nickycheng opened 1 year ago
hi, hertzbeat support deploy behind a proxy like nginx.
maybe we can add a server.basePath configuration like kibana?
maybe you can try config the application.yml
file
server:
port: 1157
servlet:
context-path: /demo
如果在网关层自定义context path,可以使用rewrite移除自定义的路径前缀,例如
location ^~ /hertzbeat {
rewrite ^/hertzbeat/(.*)$ /$1 break;
proxy_pass http://hertzbeat;
}
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
If you customize the context path at the gateway layer, you can use rewrite to remove the custom path prefix, for example
location ^~ /hertzbeat { rewrite ^/hertzbeat/(.*)$ /$1 break; proxy_pass http://hertzbeat; }
I have tried to use this config:
location ^~ /hertzbeat {
rewrite ^/hertzbeat/(.*)$ /$1 break;
proxy_pass http://hertzbeat;
}
Then I can get js code when I directly request the /hertzbeat/xxx.js:
But I find that front-end static resources are directly spliced behind the domain?
So this background is not available. 😥
version: docker image (latest)
Question
does hertzbeat support deploy behind a proxy like nginx ?
I tried it, if the contextpath is added, the application cannot be used normally, and the resource paths are all wrong
maybe we can add a server.basePath configuration like kibana?
server.basePath: Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects the URLs generated by Kibana, your proxy is expected to remove the basePath value before forwarding requests to Kibana. This setting cannot end in a slash (/).