2
如何设置nginx将一个文件夹的代理反向代理到一台服务器,其余的根文件到另一台服务器?nginx proxy_pass到一个目录
根“/”由CMS管理,而“其他”是我自己的程序(独立于CMS)。
这里是我当前的配置
server {
listen 80;
server_name www.example.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
... <ssl stuff> ...
server_name www.example.com;
location /other {
proxy_pass http://192.168.2.2/other ;
}
location/{
proxy_pass http://192.168.1.1;
}
}
非常感谢你。我需要一种使用nginx作为反向代理的方式,但希望URL能够被重新编译/以文件夹为前缀。这就像一个魅力(没有位于课程的位置部分的文件夹)! – 2017-07-21 17:04:25