Glam Prestige Journal

Bright entertainment trends with youth appeal.

I have a react js app running on localhost:3000 on my vps (godaddy).

I have set up a reverse proxy using Apache web server on /var/www/html/ecommerce/app by setting .htaccess like this:

DirectoryIndex disabled
RewriteEngine On
RewriteRule ^(.*)$ [P,L]
RewriteRule ^$ [P,L] 

The idea is to access the app via .

Right now the page fails to load. Any help would be appreciated.

To test if the app is indeed running on I made an SSH tunnel:

ssh -L 3000:$GD_IP:3000 -N logan@$GD_IP

And, when I view it from my end , it worked! So something is wrong with my Apache configuration?. I did a similar reverse proxy with port 8000 and it worked.

This one worked in a different case:

DirectoryIndex disabled
RewriteEngine On
RewriteRule ^(.*)$ [P,L]
RewriteRule ^$ [P,L] 

By 'worked' I mean, say .htaccess file is under /var/www/html/ecommerce/api, then I can access it via .

When I visited the site opens! But why? .htaccess file is under /var/www/html/ecommerce/app so I was thinking it will be accessible via ?

Output of ss command:

logan@vps:~$ ss -ltn 'sport = :8000'
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 511 *:8000 *:*
logan@vps:~$ ss -ltn 'sport = :3000'
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 511 0.0.0.0:3000 0.0.0.0:*

Output of apachectl -S:

logan@vps:~$ apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ip-184-168-120-55.ip.secureserver.net. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 ip-184-168-120-55.ip.secureserver.net (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex proxy: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
1 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy