1、全站代理
#如果是宝塔,只需要下面这段
location / {
index index.html index.htm index.php;
#autoindex on;
#反向代理配置
proxy_pass http://www.866877.com
}
2、全站代理配置(首页不代理)
location = / {
index index.html index.htm index.php
}
location / {
index index.html index.htm index.php;
#autoindex on;
#反向代理配置
proxy_pass http://www.866877.com
}
3、目录代理配置
之前有一篇文章说过,可以参考:https://www.cmy.cn/host/356.html
#host目录代理显示866877.com内容
location /host/ {
proxy_pass http://www.866877.com
}
4、指定类型文件代理配置
#指定文件类型代理配置(.shtml、.htm 类型文件代理 www.866877.com)
location ~ .*\.(shtml|htm)$ {
proxy_pass http://www.866877.com
}