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 http://127.0.0.1:81; }

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

and

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

both do not work.

Please suggest the correct one.

link|improve this question

25% accept rate
Is it the only location in your nginx config? – Alex Feb 8 '11 at 20:03
feedback

1 Answer

up vote 1 down vote accepted

Try the following:

location /cometchat/ {
    proxy_pass http://127.0.0.1:81;
}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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