Skip to content

Instantly share code, notes, and snippets.

@soupmatt
Created July 1, 2011 13:51
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save soupmatt/1058580 to your computer and use it in GitHub Desktop.
Save soupmatt/1058580 to your computer and use it in GitHub Desktop.
Apache reverse proxy config for pow
<VirtualHost *:80>
ServerName pow
ServerAlias *.dev
ServerAlias *.xip.io
ProxyPass / http://localhost:20559/
ProxyPassReverse / http://localhost:20559/
ProxyPreserveHost On
</VirtualHost>
@johnpipi
Copy link

If you use nginx instead of apache on osx like I do then this will work:

server {
    listen      80;
    server_name pow *.dev *.xip.io;

    charset utf-8; 
    ignore_invalid_headers on;

    location / {
        proxy_set_header  X-Real-IP  $remote_addr;        
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
        proxy_set_header Host $host;
        proxy_pass http://localhost:20559/;        
    }    

}

@bobbdelsol
Copy link

I know i'm poking in the dark a bit here, but I've set pow and nginx up per Ryan Bates RailsCast #357. Work great, but of course POW hijacks the localHost. I'm using my localhost http://127.0.0.1 for local storage (simulating my S3 store for production). I've done the revere apache changes, now Apache hijacks the POW ports. i'm sure it's something simple since i'm no webserver expert. Any suggestions. Ryan should include your post in his railscast:)

@allaire
Copy link

allaire commented Nov 21, 2013

Simply add ServerAlias *.ngrok.com for ngrok support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment