Created
July 1, 2011 13:51
-
-
Save soupmatt/1058580 to your computer and use it in GitHub Desktop.
Apache reverse proxy config for pow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName pow | |
ServerAlias *.dev | |
ServerAlias *.xip.io | |
ProxyPass / http://localhost:20559/ | |
ProxyPassReverse / http://localhost:20559/ | |
ProxyPreserveHost On | |
</VirtualHost> |
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/;
}
}
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:)
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
@spencerdcarlson I have the exact opposite problem. Dorfire's solutoon causes apache to server all the request I'd expect pow to make. @dobb's works perfectly, thank you!