refactor(nginx): 调整nginx配置文件位置并优化配置结构

将worker_rlimit_nofile配置移到http块之前,并修改Dockerfile中的nginx配置文件路径
This commit is contained in:
feige996
2025-09-17 12:24:54 +08:00
parent ebd4694aa6
commit cecbb38a40
2 changed files with 4 additions and 5 deletions

View File

@@ -28,8 +28,7 @@ FROM nginx:1.29.1-alpine3.22 AS production-stage
# 将构建好的项目复制到nginx下
COPY --from=builder /app/dist/build/h5 /usr/share/nginx/html
# 将默认的nginx配置文件替换为我们自定义的nginx配置文件
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/nginx.conf
# 暴露端口
EXPOSE 80

View File

@@ -11,6 +11,9 @@ events {
use epoll;
}
# 文件描述符限制 - 移到这里在http块之前
worker_rlimit_nofile 65535;
http {
# 日志格式定义
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
@@ -46,9 +49,6 @@ http {
client_header_timeout 60s;
client_body_timeout 60s;
# 文件描述符限制
worker_rlimit_nofile 65535;
server {
listen 80;
server_name _;