I have been stuck with this issue for a while and getting desperate for some helps.
I am currently building a website with NodeJS and I am using AWS EC2 with Pound for routing configuration. For one part of the website, I want to redirect the visitor to an external website (e.g.: google.com) by using node res.redirect("http:// google.com"). However, this keeps getting redirected back to my homepage.
My understanding, it goes like this:
If I try to use res.redirect('http:// google.com/something'), it will get redirected to http:// home.com/something.
This redirection works just fine in localhost (e.g. the user is able to reach the external URL), which means that this has something to do with my AWS EC2 or POUND configuration.
Has someone experienced this before and has a solution? Thank you very much!
Note: The space between 'http://' and the URL in this question is intended so they don't become a Link here. The space does not exist in my implementation.
I figures that this behaviour is caused by POUND Configuration because I put:
ListenHTTP
Address 0.0.0.0
Port 80
Whereas I am supposed to replace the Address with the server IP Address.
This is referred as below in the config description:
Address address The address that Pound will listen on. This can be a numeric IP address, or a symbolic host name that must be resolvable at run-time. This is a mandatory parameter. The address 0.0.0.0 may be used as an alias for 'all available addresses on this machine', but this practice is strongly discouraged, as it will interfere with the rewriting mechanisms (see below).
Refer to the following website for further info: http://linux.die.net/man/8/pound