在服务器端我的博客是http://127.0.0.1:8080/blog下面的,我想通过nginx的反向代理到www.111cn.net的域名下
比如原来文章的url是http://127.0.0.1:8080/blog/article/123
现在我想这么访问:
域名/article/123
代码如下server {
listen 80;
server_name www.111cn.net;
location / {
rewrite ^/(.*)$ /blog/$1 last;
}
location ~* ^/blog/.*$ {
proxy_pass http://127.0.0.1:8080;
}
}
【nginx代理指定目录命令行】nginx代理指定目录命令方法
http://m.bbyears.com/caozuoxitong/43467.html
推荐访问: