用戶訪問以前的網站能跳到現在的網站(可能該了域名,誤刪除等)
在代理機器的配置文件 vim /usr/local/nginx/conf/nginx.conf下修改配置
[root@proxy ~]# vim /usr/local/nginx/conf/nginx.conf
.. ..
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
rewrite /a.html /b.html; 【在這個配置文件中加入這樣行即可“重寫a網站爲b 網站”】
}
}
外面需要寫入一個字符來測試網頁
echo "AAA" > /usr/local/nginx/html/a.html
firefox 192.168.4.5/a.html