如何将以下 proxypass 规则从 apache 转换为 nginx
ProxyPass /症状搜索 http://medgle.com/symptoms-search ProxyPassReverse /symptoms-search http://medgle.com/symptoms-search ProxyPass /ajaxmatch.jsp http://medgle.com/ajaxmatch.jsp ProxyPassReverse /ajaxmatch.jsp http://medgle.com/ajaxmatch.jsp
答案1
下面的NGINX指令应该可以解决问题:
location /symptoms-search {
proxy_pass http://medgle.com/symptoms-search;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location = /ajaxmatch.jsp {
proxy_pass http://medgle.com/ajaxmatch.jsp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
你可能还需要配置许多其他选项,请参阅 NGINXhttp 代理模块文档了解详情。