Error when running under NGINX reverse proxy
Posted: Tue Sep 03, 2024 6:30 pm
I'm trying to run the Reports.Java installed in a server under NGINX as reverse proxy configured as following:
But the application fail to load because the Stimulsoft tries to load the resources under the URL: https://www.myserver.com/... instead of https://www.myserver.com/hor-rel-tre/...
I suspect this is because the Stimulsoft does not identify internally the reverse proxy location /hor-rel-tre
Here in this line, the library tries to build a context URL as following:
https://imgur.com/a/nc4LaCx
Scheme: https://
Server Name: www.myserver.com
Server Port: 443
Context Path: /
Final URL: https://www.myserver.com/
Correct URL: https://www.myserver.com/hor-rel-tre
The library apparently is not prepared to run under reverse proxy. Any advice to overcome this situation?
Code: Select all
location /hor-rel-tre/ {
proxy_pass http://127.0.0.1:8020/;
proxy_set_header Host $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-Proto https;
proxy_set_header X-Forwarded-Prefix /hor-rel-tre;
}
I suspect this is because the Stimulsoft does not identify internally the reverse proxy location /hor-rel-tre
Here in this line, the library tries to build a context URL as following:
https://imgur.com/a/nc4LaCx
Scheme: https://
Server Name: www.myserver.com
Server Port: 443
Context Path: /
Final URL: https://www.myserver.com/
Correct URL: https://www.myserver.com/hor-rel-tre
The library apparently is not prepared to run under reverse proxy. Any advice to overcome this situation?