0

I'm running a meteor application, due to restrictions I must use Apache as the webserver. There are also other existing websites hosted on the same domain under different locations e.g. https://example.com/phpsite1, https://example.com/phpsite2.

The application I'm interested in runs on http://localhost:3000.

Essentially I would like to have a new location on the same domain, https://example.com/mymeteorapp where requests to this page map to http://localhost:3000.

I've been playing with proxypass but struggling to get something working. Any help or examples would be great.

techraf
  • 4,163
  • 8
  • 27
  • 44

1 Answers1

0

The classic reverse proxy syntax would be set up within a <Location> tag in the Apache config. Something like:

<Location "/mymeteorapp1/">
  ProxyPass "http://localhost:3000/"
</Location>

Should do what you want. This will strip everything off after the /mymeteorapp1/ and feed it to the backend application running on port 3000. The documentation at https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass provides some very clear examples.

Thomas N
  • 436
  • 2
  • 9
  • thanks! due to routing in the meteor application i couldn't use the location `"/mymeteorapp1/"` i had to use `"/"`. also to make sure i could access the other php sites at different locations i needed to add `ProxyPass /phplocation !` – androidwiltron Aug 24 '16 at 09:47