发布网友
共1个回答
热心网友
在 nginx.conf 中配置多个个server即可:
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
27
28
29
30
31
32
33
34
35
36
37
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
upstream localhost {
server 127.0.0.1:8080 max_fails=7 fail_timeout=7s;
}
server {
listen 81;
server_name localhost;
location / {
root html;
index index.html index.htm;
proxy_pass http://localhost;
}
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
proxy_pass http://localhost;
}
}
}