常用代理配置方式
# 1、代理页面文件根目录
location / {
root /home/webPage;
index index.html index.htm;
}
# 2、适用场景:同台服务器,不同目录。
# 代理页面文件目录2
location /app {
alias /home/appPage;
index index.html index.htm;
}
# 3、静态资源目录
location /resources/ {
alias '/home/resources/';
autoindex off;
}
# 4、反向代理
location /externalApp/ {
proxy_pass http://192.168.1.102:8080/candy/getTypeInfos=all;
proxy_redirect off;
}