-
Notifications
You must be signed in to change notification settings - Fork 23
/
default.conf
36 lines (31 loc) · 1.06 KB
/
default.conf
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
upstream my_server{
server 121.41.4.33:3000; # 后端server 地址
keepalive 2000;
}
server {
listen 80;
server_name http://120.24.69.103; # 修改为docker服务宿主机的ip/域名,比如我之前说的11.22.33.44
#charset koi8-r;
access_log /var/log/nginx/host.access.log main;
error_log /var/log/nginx/error.log error;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
proxy_set_header Host $host:$server_port;
try_files $uri $uri/ /index.html;
# try_files $uri $uri/ /index.html =404;
}
# 这里就是和vite本地代理的意思一样,已api开头的路径都代理到本机的3000端口
location /api {
proxy_pass http://localhost:7228/api;
proxy_set_header Host $host:$server_port;
proxy_buffer_size 1024k;
proxy_buffers 16 1024k;
proxy_busy_buffers_size 2048k;
proxy_temp_file_write_size 2048k;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}