Site icon moneyslow.com

nginx 目录禁止ip 重定向域名不发生变化

nginx 目录禁止ip
location /zgadmin {
allow 220.220.22.92;
deny all;
}

nginx 实现A域名重写到B域名而不引起浏览器中url的变化?
rewrite与proxy_pass搭配使用:

location ~ ^/frompath/ {
rewrite ^/frompath/(.*)$ /topath/$1 break;
proxy_pass http://www.domainB.com;
}

既可以实现http://www.a.com/frompath/page.php 被重写到 http://www.b.com/topath/page.php 而不引起浏览器地址栏中url的变化。

Exit mobile version