apache - Nginx as Reverse Proxy - Double Proxy Pass ? is this possible? -
i have common problem can encounter when run nginx reverse proxy server apache, want add double proxy_pass variables nginx conf. file doesn't seems allowed nginx.
for example situations have in website have chat engine runs openfire, runs on port 5280 jetty , have set apache proxy pass directive set
proxypass /member-chat http://xyx.com:5280/http-bind proxypassreverse /member-chat http://xyx.com:5280/http-bind proxyrequests off
but want pass comes "/member-chat" send directly chat-server rather apache, because apache again proxy pass openfire (member-chat), takes more time , useless loading apache.
when add nginx proxy server want add below didn't work, reason, cant find location gives me 404 error.
location / { proxy_pass http://85.xxx.yyy.2x2:7080; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; access_log off; } location ~ ^/member-chat { proxy_pass http://85.xxx.yyy.2x2:5280; proxy_connect_timeout 300; }
i believe missed out on specifying uri jetty service. current configuration, request land on jetty port be:
http://85.xxx.yyy.2x2:5280/member-chat
this per proxy_pass documentation.
if proxy_pass specified without uri, request uri passed server in same form sent client when original request processed, or full normalized request uri passed when processing changed uri
i don't think expect looking @ apache configuration same. try configuring uri proxy_pass directive have done apache.
location ~ ^/member-chat { proxy_pass http://85.xxx.yyy.2x2:5280/http-bind; proxy_connect_timeout 300; }
Comments
Post a Comment