如何设置nginx将单个文件夹反向代理到一个服务器,将其余的root代理反向代理到另一个服务器?
根"/"由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;
}
}
Run Code Online (Sandbox Code Playgroud)