Mekajiki
Mekajiki

Reputation: 941

How to exclude UserDir paths from ProxyPass

I want to configure apache UserDir cooperating with ProxyPass, that is, want all requests but starting with /~ passed to proxy.

Firstly I have ProxyPass settings for a Rails application as bellow:

ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/

and, now I want to add public_html UserDir setting to this.

In other words, I want the requests to http://example.com/hoge/fuga goes to rails app, but those to http://example.com/~userrefer to refer to /home/user1/public_html directory.

How can I do this?

Upvotes: 0

Views: 864

Answers (2)

Mekajiki
Mekajiki

Reputation: 941

I've solved the problem by adding the line bellow to the apache config;

ProxyPassMatch ^/~ !

Upvotes: 3

arco444
arco444

Reputation: 22871

Does the below work?

ProxyPass /~ !
ProxyPass / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/

! will tell mod_proxy not to forward requests beginning /~

Upvotes: 0

Related Questions