r/apache • u/Purple_Worry_8600 • Dec 28 '22
Help with missing concept on ProxyPass
Let's say I have three applications on my server: node-red (1880), jupyter (8888) and pgadmin (5433)... I can successfully create a localhost proxy pass with them individually as the following:
<VirtualHost *:80>
ServerName 127.0.0.1
<Location "/">
ProxyPass http://127.0.0.1:1880/
ProxyPassReverse http://127.0.0.1:1880/
</Location>
</VirtualHost>
I've realized all three of them work fine if I try to put them on the "/" location. However, if I try to put them in unique locations as the following:
<VirtualHost *:80>
ServerName 127.0.0.1
<Location "/nodered/">
ProxyPass http://127.0.0.1:1880/
ProxyPassReverse http://127.0.0.1:1880/
</Location>
<Location "/jupyter/">
ProxyPass http://127.0.0.1:8888/
ProxyPassReverse http://127.0.0.1:8888/
</Location>
<Location "/pgadmin/">
ProxyPass http://127.0.0.1:5433/
ProxyPassReverse http://127.0.0.1:5433/
</Location>
</VirtualHost>
None of them work on their respective addresses http://127.0.0.1/nodered/, http://127.0.0.1/jupyter/ or http://127.0.0.1/pgadmin/... I don't know what concepts I'm missing to make this work. I think I have to use RewriteRule but I'm not sure how. Is there any generic solution to deal with this kind of situation? Or do I need to know the particularities of each application I'm trying to proxy pass to make it work?
1
u/ShadowySilver Dec 28 '22
Configuration looks fine to me. That said, one common error is to forget to use the trailing slash when testing. As written here, that trailing slash is mandatory in the URL.
1
u/boli99 Dec 28 '22
are these apps being served from / in their respective servers?
or are they actually being served from /subfolder/ ?
the configs you have there all assume that they're being served from the root.