apache maps /openmrs incorrectly - traffic forwarded doesn't work

Hi everyone, in ssl.conf, the path /openmrs is mapped to http://localhost:8080/openmrs which is correct. It works when you access the webserver IP directly (e.g. in the provided vagrant machine it is “https://192.168.33.10/openmrs”), but if you access it indirectly, e.g. if you have a port forward in your firewall to the internal server, you can’t access /openmrs - it gives the error Bad Response.

You can try this with an SSH tunnel: “ssh user@yourbahmniserver -L 1234:localhost:443” and then in your browser, go to “https://localhost:1234/openmrs”. It will give the “Bad Request” message. However, if you put a trailing slash and a file after: “https://localhost:1234/openmrs/index.htm” it works, but if you navigate from there to urls ending in “/” it will give the “Bad Request” again.

I solved it by editing ssl.conf “ProxyPreserveHost” to Off. I am not sure if this is the best solution for the problem, but it fixed it. Note: /bahmni always works. Maybe an issue of apache forwarding to tomcat?