我在Nginx Web服务器后面安装了pentaho。我想做的是将我的/重定向到/ pentaho而不成功。这是我的虚拟主机文件:
server {
listen 80;
server_name estrategia-bi.ddns.net;
root /var/lib/tomcat7/webapps/pentaho;
# rewrite ^(.*)$ $scheme://estrategia-bi.ddns.net/pentaho/Login;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Server $host;
}
}
我尝试了不同的方法,例如:
proxy_pass http://127.0.0.1:8080/pentaho/;
但这给了我一种空白或部分加载的页面。
rewrite ^(.*)$ $scheme://estrategia-bi.ddns.net/pentaho;
但这给了我一个服务器错误,例如网址不完整?
我不知道该怎么做。希望有人能帮助我。
问候!
此重写为我们工作:
server {
listen 80;
server_name estrategia-bi.ddns.net;
root /var/lib/tomcat7/webapps/pentaho;
rewrite ^/$ /pentaho/ permanent;
location / {
proxy_pass http://localhost:8080/;
}
}
我们从来没有找到一种完全重定向所有内部url的方法-您放置在本地的东西无法做到这一点,我们尝试过的其他任何方法也不起作用。Pentaho似乎只是忽略标题。
但是,此重写将使您进入登录页面。登录后,由于某种原因,您将被重定向到http:// localhost:8080 / pentaho /。重新加载主页,您应该已登录,然后一切正常。
@markemus提到的问题源于将https反向代理到http。浏览器安全性将阻止加载混合内容。我终于可以使用以下配置使它正常工作。我此配置在端口443上包含https和证书,但在端口80和http或在NINNX中从80重定向到443时,它可以轻松工作。
NGINX:
server {
listen [::]:443 ssl;
listen 443 ssl;
server_name my.exampledomain.com;
ssl_certificate /path/to/certificate
ssl_certificate_key /path/to/key
location /pentaho/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/pentaho/;
}
}
修改pentaho-server / tomcat / conf / server.xml以匹配条目:
<Connector URIEncoding="UTF-8" port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
proxyName="my.exampledomain.com"
proxyPort="443"
scheme="https"
/>
修改pentaho-server / pentaho-solutions / system / server.properties以匹配条目:
fully-qualified-server-url=https://my.exampledomain.com/pentaho/
确保重新启动pentaho服务器和nginx