我需要在/jenkins路径上访问Jenkins服务器。
这就是我现在在apache配置中拥有的内容:
ProxyPass /jenkins http://localhost:8080
ProxyPassReverse /jenkins http://localhost:8080我去example.com/jenkins的时候,
我被重定向到example.com/login?from=%2F,
而不是预期的exmaple.com/jenkins/login?from=%2F。
那么,是否可以使用apache来发出来自我的Jenkins服务器的所有请求,而不是使用example.com/jenkins/*而不是example.com/*?
P.S.:我知道这将是一个更好的实践--创建一个名为jenkins.example.com的新服务器,但这对我来说目前不是一个选择。
发布于 2017-09-15 12:56:15
我在虚拟index.html上测试了这样的设置。
ProxyPass "/jenkins" http://192.168.0.99
ProxyPassReverse "/jenkins" http://192.168.0.99就像这样,当我打开http://example.com/jenkins时,我被重定向到http://192.168.0.99的index.html。
你应该看看詹金斯的htdocs词根。如果有类似于<meta http-equiv="refresh" content="0;URL=/login?from=%2F">的重定向,那么它将重定向到example.com/login?from=%2F。如果使用前导.将重定向更改为相对路径,则它将正确地重定向:
<meta http-equiv="refresh" content="0;URL=./login?from=%2F">就像这样,它将正确地重定向到example.com/jenkins/login?from=%2F
https://serverfault.com/questions/873796
复制相似问题