forked from JohnDoe1996/fastAPI-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf.example
34 lines (30 loc) · 1.01 KB
/
nginx.conf.example
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
upstream fastapi-backend {
server 127.0.0.1:8100 weight=20 max_fails=200 fail_timeout=20s;
server 127.0.0.1:8101 weight=20 max_fails=200 fail_timeout=20s;
}
server {
listen 80;
server_name localhost;
client_max_body_size 5m;
error_log /home/ubuntu/log/nginx/fastapi-backend.error.log;
access_log /home/ubuntu/log/nginx/fastapi-backend.access.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-User-Agent $http_user_agent;
proxy_pass http://fastapi-backend;
}
}
server {
listen 80;
server_name localhost;
client_max_body_size 5m;
error_log /home/ubuntu/log/nginx/fastapi-frontend.error.log;
access_log /home/ubuntu/log/nginx/fastapi-frontend.access.log;
location / {
root /home/ubuntu/opt/fastAPI-vue/frontend/dist;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
}