Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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>
@fojas

This comment has been minimized.

Copy link

@fojas fojas commented Jun 12, 2012

"ServerAlias *.xip.io" should be added for xip.io support with pow >= 4.0.

@soupmatt

This comment has been minimized.

Copy link
Owner Author

@soupmatt soupmatt commented Jun 13, 2012

ServerAlias *.xip.io added per @fojas

@dorfire

This comment has been minimized.

Copy link

@dorfire dorfire commented Nov 18, 2012

I find this configuration better suited for the userdir module:
https://gist.github.com/4104494

@dobbs

This comment has been minimized.

Copy link

@dobbs dobbs commented Nov 27, 2012

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 ^/~ !

see https://gist.github.com/4154421

@spencerdcarlson

This comment has been minimized.

Copy link

@spencerdcarlson spencerdcarlson commented Mar 13, 2013

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

@JacksonGariety

This comment has been minimized.

Copy link

@JacksonGariety JacksonGariety commented May 4, 2013

@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!

@johnpipi

This comment has been minimized.

Copy link

@johnpipi johnpipi commented Jun 23, 2013

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

This comment has been minimized.

Copy link

@bobbdelsol bobbdelsol commented Aug 2, 2013

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

This comment has been minimized.

Copy link

@allaire 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
You can’t perform that action at this time.