0

I made a proxy pass adding to my localhost instance the path /vocab/arch. Here the configuration I used:

        <IfModule mod_proxy.c>

                ProxyPass /vocab/arch http://localhost:3000/
                ProxyPassReverse /vocab/arch http://localhost:3000/
                Alias /vocab/arch /assets/
        </IfModule>

        <Location />
                Require all granted
        </Location>

        RewriteEngine On
        RewriteRule  ^/vocab/arch   -  [L]
        RewriteRule  ^/(.*)    http://localhost:3000/$1  [P,L]
        ProxyPassReverse /vocab/arch     http://localhost:3000/

Pointing to http://localhost:3000/ I'm having the landing page of my web-app as expected under http://localhost:3000/vocab/arch/en.html.

However clicking on some link like "Collections" I'm having https://localhost:3000/en/collections.html instead of https://localhost:3000/vocab/arch/en/collections.html

How can I solve this issue?

Thanks in advance

Pelide
  • 101
  • What vHost do these directives reside under? "Pointing to http://localhost:3000/ I'm having the landing page of my web-app as expected under http://localhost:3000/vocab/arch/en.html" - which part of your config is doing that? Your "collections" URL is using HTTPS - not HTTP (as you've seemingly defined above)? – MrWhite Nov 07 '19 at 19:51

1 Answers1

0

Fix your sub-host. proxy-pass won't re-write responses coming from the other web-server. So, if the other-server (on port 3000) gives hrefs and links to URLs without proper paths, you'll see exactly what you've got.

i.e. your localhost:3000 server is returning links to https://localhost:3000/en/collections.html instead of https://localhost:3000/vocab/arch/en/collections.html

TheCompWiz
  • 7,409
  • 17
  • 23
  • Thanks for your reply. Can you please give me an example? – Pelide Nov 07 '19 at 22:36
  • I have no clue what your sub-host is running. I would modify it so it works with the same paths that exist in the parent host. i.e. /vocab/arch/ instead of just working from /en/ – TheCompWiz Nov 07 '19 at 23:03