Files
MoviePilot/docker/nginx.template.conf

54 lines
1.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
user moviepilot;
# 只代理单用户 WebUI 与 API,固定 2 个 worker 足够,auto 会按 CPU 核数起进程,多核 NAS 上白占内存
worker_processes 2;
pid /var/run/nginx.pid;
worker_cpu_affinity auto;
events {
worker_connections 1024;
}
http {
# 站点图标使用临时磁盘缓存,限制容量并按闲置时间回收。
proxy_cache_path /tmp levels=1:2 keys_zone=my_cache:10m max_size=100m inactive=60m use_temp_path=off;
sendfile on;
keepalive_timeout 3600;
client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_proxied any;
gzip_min_length 256;
gzip_vary on;
gzip_comp_level 6;
# 明文 HTTP 入口
server {
include /etc/nginx/mime.types;
default_type application/octet-stream;
listen ${NGINX_PORT};
listen [::]:${NGINX_PORT};
server_name moviepilot;
# 公共配置
include common.conf;
}
# 按证书配置生成的 HTTPS 入口
${HTTPS_SERVER_CONF}
upstream backend_api {
# 后端仅通过容器内的回环地址代理访问
server 127.0.0.1:${PORT};
# 与 API 代理的 HTTP/1.1 空 Connection 头配合,复用本地上游连接。
keepalive 32;
}
}