使用nginx的rewrite实现代理指定目录
笔记
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
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;
}
|
有时间在整理
本文转自 cs312779641 51CTO博客,原文链接:http://blog.51cto.com/chenhao6/1722856