I set up an Apache VirtualHost to proxy my node.js App:
<VirtualHost *:80>
CustomLog /var/log/apache2/access_log combinedvhost
ErrorLog /var/log/apache2/error_log
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
When trying to log in via Google OAuth with passport.js I get a 502 error after the redirect:
502:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /auth/google/callback.
Reason: Error reading from remote server
Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 Server at
server.domain.com Port 80
Why? Everything works perfect if I run it from my development machine on localhost.