I am trying to configure a proxy server for my Node.js server on my EC2 instance, so I can access it through something like http://*.amazonaws.com/node , where * is the rest of the URI. I installed the proxy server by editing /etc/httpd/conf/httpd.conf as follows:
<Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /node http:
My Node.js server.js file is as follows:
var port = process.env.PORT || 3000; var host = '*.amazonaws.com' || process.env.HOST || '127.0.0.1';
So, when everything works and works for me, I can access / node , however, the Node.js / public directory is not used as the root directory of the document, so I get 404s for any index.html file, because it accepts it in the directory / public . For example, Firebug reports 404 for http://*.amazonaws.com/javascripts/rails.js and 3 other files, which means that it does not fall into the Node.js / public directory.
Itβs good to note that if I edit the paths in the index.html file, everything works, but I would prefer not to do this ... also if I select the ProxyPass configuration in httpd.conf and just access the node server from http://*.amazonaws.com:3000 , it works ... but ideally I wouldnβt want to do this and could do / node .
I want to know if my proxy is configured correctly, and if not, how can I fix it, so when I access / node , all the requested files are redirected themselves?
source share