(本文档仅供参考)(nginx的方案源于网上资料,本文档仅供参考)
背景
直接访问smartbi地址应用名称是smartbi,但是由于实际需要通过nginx修改了应用名称,或者在smartbi应用前添加了一层应用名,如smartbi地址为:http://10.10.12.91:18080/smartbi,通过nginx修改了应用名增加了一层路径,地址是:http://10.10.12.91/oa/smartbi,此时是容易出现较多问题的。
...
在nginx.conf文件location节点中增加配置:proxy_redirect http://$host/smartbi /oa/smartbi;
如果该配置未解决,可使用:proxy_redirect /smartbi /oa/smartbi;
如图:
保存配置,重启nginx。
...
nginx代理后的smartbi地址 | smartbi原始地址 | proxy_set_header | proxy_redirect | proxy_cookie_path |
---|---|---|---|---|
http://ip/smartbi | http://ip:18080/smartbi | —— | —— | —— |
http://ip/bi | http://ip:18080/smartbi | —— | http://$host/smartbi /bi | /smartbi /bi |
http://ip | http://ip:18080/smartbi | —— | http://$host/smartbi/ / | /smartbi / |
http://ip | http://ip:18080/ | —— | —— | —— |
http://ip/bi | http://ip:18080/ | —— | http://$http_host /bi 或http://$host /bi | / /bi |
http://ip/oa/smartbi | http://ip:18080/smartbi | —— | http://$host/smartbi /oa/smartbi 或 /smartbi /oa/smartbi; | / /oa/ |
http://ip:8088/smartbi | http://ip/smartbi | Host $host:$server_port | —— | —— |
https://ip/smartbi | http://ip:18080/smartbi | —— | http:// https:// | —— |
https://ip:8443/smartbi | http://ip:18080/smartbi | Host $host:$server_port | http:// https:// | —— |
https://ip/smartbi | https://ip:18443/smartbi | —— | —— | —— |
https://ip:8443/smartbi | https://ip:18443/smartbi | Host $host:$server_port | —— | —— |
https://ip/bi | https://ip:18443/smartbi | —— | https://$host/smartbi /bi | /smartbi /bi |
https://ip | https://ip:18443/smartbi | —— | https://$host/smartbi / | /smartbi / |
...