使用nginx的rewrite实现代理指定目录
笔记
server {
listen 80;
server_name a.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
#root html;
#index index.html index.htm;
rewrite ^/.(.*)$ /sos/$1 last;
}
location ~* ^/sos/.*$ {
proxy_pass http://127.0.0.1:8080;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
有时间在整理
本文出自 “浩子的▁运维笔录ヽ” 博客,请务必保留此出处http://chenhao6.blog.51cto.com/6228054/1722856
原文:http://chenhao6.blog.51cto.com/6228054/1722856