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.

  • Is it the only location in your nginx config? – Alex Feb 8 '11 at 20:03

Try the following:

location /cometchat/ {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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