I've set up a reverse proxy on my vps by placing the following
.htaccess
file under /var/www/html/ecommerce/app.
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]
RewriteRule ^$ http://127.0.0.1:3000 [P,L]
localhost:3000 is the local node server running on my vps.
/var/www/html/ is the document root. So I was expecting, if all goes well, I can load the app via http://my-public-vps-ip/ecommerce/app . But that doesn't work and instead I can load the app via http://my-public-vps-ip:3000 .
I don't understand this. Could you help me understand what might be going on?
Asked by Logan Lee
(249 rep)
Jun 28, 2021, 10:41 PM