Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.