2024-04-29 10:00:29 +00:00
|
|
|
# 启动的 worker 进程数量
|
|
|
|
worker_processes auto;
|
|
|
|
|
|
|
|
# 错误日志路径和级别
|
|
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
|
|
|
|
events {
|
|
|
|
# 最大连接数
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
server {
|
2024-05-20 10:37:12 +00:00
|
|
|
listen 80;
|
2024-04-29 10:00:29 +00:00
|
|
|
# IPv6端口
|
2024-05-20 10:37:12 +00:00
|
|
|
listen [::]:80;
|
2024-04-29 10:00:29 +00:00
|
|
|
server_name localhost;
|
|
|
|
# gzip config
|
|
|
|
gzip on;
|
|
|
|
gzip_min_length 1k;
|
|
|
|
gzip_comp_level 9;
|
|
|
|
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
|
|
|
|
gzip_vary on;
|
|
|
|
gzip_disable "MSIE [1-6]\.";
|
|
|
|
root /xiaoju-survey/web/dist;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
try_files $uri $uri /management.html;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /management/ {
|
|
|
|
try_files $uri $uri/ /management.html;
|
|
|
|
}
|
|
|
|
|
2024-06-11 08:04:00 +00:00
|
|
|
location /management/preview/ {
|
|
|
|
try_files $uri $uri/ /render.html;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-04-29 10:00:29 +00:00
|
|
|
location /render/ {
|
|
|
|
try_files $uri $uri/ /render.html;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /api {
|
|
|
|
proxy_pass http://127.0.0.1:3000;
|
|
|
|
}
|
2024-07-18 02:21:09 +00:00
|
|
|
|
2024-09-12 14:10:18 +00:00
|
|
|
location /exportfile {
|
|
|
|
proxy_pass http://127.0.0.1:3000;
|
|
|
|
}
|
2024-07-18 02:21:09 +00:00
|
|
|
# 静态文件的默认存储文件夹
|
|
|
|
# 文件夹的配置在 server/src/modules/file/config/index.ts SERVER_LOCAL_CONFIG.FILE_KEY_PREFIX
|
|
|
|
location /userUpload {
|
|
|
|
proxy_pass http://127.0.0.1:3000;
|
|
|
|
}
|
2024-04-29 10:00:29 +00:00
|
|
|
|
|
|
|
error_page 500 502 503 504 /500.html;
|
|
|
|
client_max_body_size 20M;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|