Score:0

Apache ProxyPass adding Port only on base URL

in flag

This is getting frustrating to say the least haha.

I have setup a proxypass and proxypassreverse in apache under virtual host 443 to proxy to nginx running in a container on port 8443.

This is all I have set up to do this

CustomLog /srv/apps/ktech-connect/log/apache/custom.log combined
ErrorLog /srv/apps/ktech-connect/log/apache/errors.log

SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPass        / https://127.0.0.1:8443/
ProxyPassReverse / https://127.0.0.1:8443/

When I hit any url such as example.com/page it works like it should But when I go to example.com or even example.com/ it will show a redirect from apache to example.com:8443 in the url.

I have tried adding ProxyPreserveHost but it does nothing, and a whole host of other options. I just don't understand where the redirect is coming from and the fact that it only happens when hitting the base url.

Any thoughts?

Gerard H. Pille avatar
in flag
The redirect is not coming from the snippet of config that you show. It may come from anywhere, even your browser's cache.
in flag
@GerardH.Pille I had set a rewrite with a redirect this morning but removed it, so maybe it is my browser cache...I will clean that up and see if that is the issue. Thank you!
in flag
@GerardH.Pille Oh my, you are a genius lol...it was my browser cache. I feel like such an idiot. Answer and I'll accept it.
Gerard H. Pille avatar
in flag
I've been there myself ;-)
Score:1
in flag

The redirect is not coming from the snippet of config that you show. It may come from anywhere, even your browser's cache.

in flag
Maybe you could have a look at another open question of mine if you are bored ;) https://serverfault.com/questions/1066681/upgrading-websocket-using-nginx-and-daphne-only-works-if-i-put-port-number-in-a
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.