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.