Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a rails app running on nginx and passenger. I want to proxy all the requests comming on the url /cometchat to the apache server running on port 81.

So all requests /cometchat /cometchat/xyz /cometchat/xyz/abc/1.html

etc should go to the apache server on port 80.

Is have tried the following

location ^~ /cometchat/ { proxy_pass; }

this works only when the request is /cometchat/ but doesnot work when it is /cometchat/index.html


location ~ ^/cometchat/(.*)$ { #alias /home/website/files/$1; proxy_pass; }

both do not work.

Please suggest the correct one.

share|improve this question
Is it the only location in your nginx config? –  Alex Feb 8 '11 at 20:03

1 Answer 1

up vote 1 down vote accepted

Try the following:

location /cometchat/ {
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.