-
Notifications
You must be signed in to change notification settings - Fork 755
Expand file tree
/
Copy pathnginx.conf
More file actions
35 lines (30 loc) · 947 Bytes
/
nginx.conf
File metadata and controls
35 lines (30 loc) · 947 Bytes
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
# nginx.conf
user root; # 定义 Nginx 进程的运行用户
worker_processes 1; # 设置 Nginx 进程数
events {
worker_connections 1024; # 每个 worker 进程最大连接数
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 8008;
server_name localhost;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
location /api/ {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://localhost:8009;
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-Forwarded-Proto $scheme;
}
location /tele-images/ {
proxy_pass http://localhost:8009;
proxy_set_header Host $host;
}
}
}