Skip to content

Instantly share code, notes, and snippets.

@shimondoodkin
Created December 3, 2011 15:49
Show Gist options
  • Select an option

  • Save shimondoodkin/1427425 to your computer and use it in GitHub Desktop.

Select an option

Save shimondoodkin/1427425 to your computer and use it in GitHub Desktop.
apache nodejs reverse proxy, note this is half tested
RewriteEngine On
RewriteRule ^$ http://127.0.0.1:8080/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:8080/$1 [P,L]
# see 'proxy|P' (force proxy) http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
connect()
.use(function(req,res,next){
req.headers.host='212.213.44.179'
req.connection.encrypted = req.headers.https=='on'; # add in apache htaccees: Header set https "%HTTPS"
req.headers.port=80;
next();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment