Upload nginx.conf
Browse files- nginx.conf +36 -0
nginx.conf
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
worker_processes auto; # 工作进程数,auto 表示由 Nginx 自动检测 CPU 核心数
|
2 |
+
|
3 |
+
# 错误日志
|
4 |
+
# error_log /var/log/nginx/error.log warn;
|
5 |
+
# pid /var/run/nginx.pid; # Nginx master 进程的 PID 文件
|
6 |
+
|
7 |
+
# 事件块
|
8 |
+
events {
|
9 |
+
# 每个工作进程可以同时处理的最大连接数
|
10 |
+
worker_connections 1024;
|
11 |
+
# 使用哪种事件模型,Linux上通常是epoll
|
12 |
+
# use epoll;
|
13 |
+
}
|
14 |
+
|
15 |
+
http{
|
16 |
+
|
17 |
+
server {
|
18 |
+
listen 7860 default_server;
|
19 |
+
listen [::]:7860 default_server;
|
20 |
+
|
21 |
+
server_name _;
|
22 |
+
|
23 |
+
location / {
|
24 |
+
proxy_pass http://localhost:3000;
|
25 |
+
}
|
26 |
+
|
27 |
+
proxy_set_header Authorization $http_my_auth;
|
28 |
+
|
29 |
+
# 常用的一些反向代理头,确保后端能正确获取客户端信息
|
30 |
+
proxy_set_header Host $host;
|
31 |
+
proxy_set_header X-Real-IP $remote_addr;
|
32 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
33 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|