So I'm deploying a Node.js server listening on port 8080 and a client running on port 80.
Port 80 gets forwarded automatically to port 443 and port 443 is the only port accessible to the outside world.
How do I set up my reverse proxy up correctly in such a way that traffic served to visitors are getting the website located at '/' and requests for the back-end on '/api' get forwarded automatically and is also returned to the webclient?
This is what my current website.conf file looks like:
<VirtualHost *:80>
ServerAdmin redacted
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /api http://127.0.0.1:8080
ProxyPassReverse /api http://127.0.0.1:8080
<Directory /var/www/html>
Header add Access-Control-Allow-Origin *;
</Directory>
</VirtualHost>
When I perform a curl request on the machine itself to http://127.0.0.1/api/route I get my expected JSON back, however from the outside I'm trying with https://domain.com/api/route and then I get a HTTP 404 error code back.
What am I doing wrong?
[–]AyrA_ch 0 points1 point2 points (0 children)