nginx反向代理增长虚拟目录

为nginx反向代理增长虚拟目录html


好比:nginx


将http://domain.com/test/abc.html 代理到 http://127.0.0.1/abc.htmlbash


方法一:dom


在反向代理路径后面添加"/"ide


location /test/ {
    proxy_pass http://127.0.0.1/;
}


方法二:代理


使用rewritehtm


location / {
    rewrite /test/(.*) /$1 break;
    proxy_pass http://127.0.0.1;
}
相关文章
相关标签/搜索