-
-
Save soupmatt/1058580 to your computer and use it in GitHub Desktop.
<VirtualHost *:80> | |
ServerName pow | |
ServerAlias *.dev | |
ServerAlias *.xip.io | |
ProxyPass / http://localhost:20559/ | |
ProxyPassReverse / http://localhost:20559/ | |
ProxyPreserveHost On | |
</VirtualHost> |
ServerAlias *.xip.io added per @fojas
I find this configuration better suited for the userdir module:
https://gist.github.com/4104494
pow intercepts requests intended for the userdir module (e.g. http://localhost/~username). Found my own solution before reading @dorfire's.
This behavior can be suppressed with the following directive inserted before the first ProxyPass
ProxyPassMatch ^/~ !
I'm not exactly sure why, but I found that @dorfire 's configuration file worked for me while adding
ProxyPassMatch ^/~ !
as mentioned in https://gist.github.com/4154421 didn't
@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!
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.
"ServerAlias *.xip.io" should be added for xip.io support with pow >= 4.0.