I thank anyone who can give me a hand! Basically, I have a WordPress site created with AWS Lightsail. So, I have an Apache server that exposes the WordPress site on my public address. On a specific path, I would like to expose an application, for example, on the path TEST PUBLIC_ADDRESS/TEST, I would like to access the application.
The application is a React project available on localhost:3000 via a Next server. The application works correctly on localhost:3000, and as mentioned, I would like to first expose this application on PUBLIC_ADDRESS/TEST. How can I do it? I tried creating a virtual host first, then opening ports, etc. but to no avail. Thank you in advance.
I tried creating a virtual host first, then opening ports, etc. but to no avail.
I do not know the setup for the WordPress Lightsail so you might need to create a VirtualHost but it might already exist so check it out.
Usual places are
/etc/apache2/confwhere you could find anhttpd.conffile. From there it can point to another multitude of files. As it is a Debian based image, I guess you would have anapache2.confand a sites-enabled folder with your different VirtualHostsNow, when you have identified where you want to add the configuration to proxy to Next. You can just add:
inside the VirtualHost of your choice. This will map
/testto localhost:3000The VirtualHost might be a new one you create with the IP or an existing one with a name if that is what you wish.
There are a couple of things to be aware of:
I believe there are other ways to achieve this but be aware that mixing path is a mess...
N.B: Also a side note on LightSail. If you try to configure a VirtualHost with the public IP and it doesn't work, try with the private one. I think there is something funny on how routing/DNS is done in LightSail...