add docker config files
This commit is contained in:
75
docker/nginx/ref/nginx.conf
Normal file
75
docker/nginx/ref/nginx.conf
Normal file
@@ -0,0 +1,75 @@
|
||||
# /etc/nginx/nginx.conf
|
||||
# Nginx 的主配置文件(通常是 /etc/nginx/nginx.conf)变更的修改
|
||||
|
||||
############################################
|
||||
# user nginx;
|
||||
# worker_processes auto;
|
||||
|
||||
# events {
|
||||
# worker_connections 1024;
|
||||
# }
|
||||
|
||||
# http {
|
||||
# include /etc/nginx/conf.d/*.conf; # 加载其他配置
|
||||
# }
|
||||
#############################################
|
||||
|
||||
|
||||
user www www; # 运行nginx的用户和组
|
||||
worker_processes auto; # 自动设置工作进程数量(建议等于CPU核数)
|
||||
error_log /www/wwwlogs/nginx_error.log crit; # 错误日志路径及最低记录级别
|
||||
pid /tmp/nginx.pid; # 主进程PID文件位置
|
||||
worker_rlimit_nofile 51200; # 提高工作进程可打开的最大文件描述符数
|
||||
|
||||
events { # 事件模块开始
|
||||
use epoll; # 指定事件驱动模型(Linux上推荐epoll)
|
||||
worker_connections 51200; # 每个工作进程允许的最大连接数
|
||||
multi_accept on; # 允许一次接收多个新连接
|
||||
} # 事件模块结束
|
||||
|
||||
http { # HTTP 主配置块开始
|
||||
include mime.types; # 引入MIME类型映射文件
|
||||
#include luawaf.conf; # 可选Lua防火墙配置(当前被注释)
|
||||
include conf.c/proxy.conf; # 引入反向代理或公共设置
|
||||
|
||||
default_type application/octet-stream; # 默认MIME类型
|
||||
|
||||
server_names_hash_bucket_size 512; # server_name哈希桶大小(影响域名匹配性能)
|
||||
client_header_buffer_size 32k; # 单个请求头的缓冲区大小
|
||||
large_client_header_buffers 4 32k; # 用于大请求头的缓冲区数量与大小
|
||||
client_max_body_size 50m; # 客户端请求体最大尺寸(上传限制)
|
||||
|
||||
sendfile on; # 启用高效文件传输sendfile
|
||||
tcp_nopush on; # 优化TCP以减少分片(与sendfile配合)
|
||||
|
||||
keepalive_timeout 60; # keep-alive连接超时时间(秒)
|
||||
|
||||
tcp_nodelay on; # 关闭Nagle算法以减少小包延迟
|
||||
|
||||
fastcgi_connect_timeout 300; # FastCGI连接超时(秒)
|
||||
fastcgi_send_timeout 300; # 发送给FastCGI的超时(秒)
|
||||
fastcgi_read_timeout 300; # 从FastCGI读取响应的超时(秒)
|
||||
fastcgi_buffer_size 64k; # FastCGI响应头缓冲区大小
|
||||
fastcgi_buffers 4 64k; # FastCGI响应的缓冲区数量和单个大小
|
||||
fastcgi_busy_buffers_size 128k; # FastCGI忙时缓冲区总大小(避免磁盘写入)
|
||||
fastcgi_temp_file_write_size 256k; # 写入临时文件前允许的阈值大小
|
||||
fastcgi_intercept_errors on; # 由nginx处理后端返回的错误页面
|
||||
|
||||
gzip on; # 启用gzip压缩响应
|
||||
gzip_min_length 1k; # 小于该长度的响应不做压缩
|
||||
gzip_buffers 4 16k; # gzip压缩时使用的缓冲区数量与大小
|
||||
gzip_http_version 1.1; # 最低支持的HTTP版本以启用gzip
|
||||
gzip_comp_level 2; # gzip压缩级别(1-9,数值越大CPU越高)
|
||||
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; # 要压缩的内容类型
|
||||
gzip_vary on; # 添加Vary: Accept-Encoding头以支持缓存代理
|
||||
gzip_proxied expired no-cache no-store private auth; # 在代理情况下是否对响应进行gzip
|
||||
gzip_disable "MSIE [1-6]\."; # 对老旧IE浏览器禁用gzip
|
||||
|
||||
limit_conn_zone $binary_remote_addr zone=perip:10m; # 基于客户端IP的连接数限制共享内存区
|
||||
limit_conn_zone $server_name zone=perserver:10m; # 基于server_name(虚拟主机)的连接数限制共享内存区
|
||||
|
||||
server_tokens off; # 禁止在响应和错误页中显示nginx版本
|
||||
access_log off; # 关闭访问日志(可根据需求启用)
|
||||
|
||||
include sites-enabled/*.conf; # 引入启用的站点(虚拟主机)配置
|
||||
} # HTTP 主配置块结束
|
||||
68
docker/nginx/ref/xcx30.5g-quickapp.conf
Normal file
68
docker/nginx/ref/xcx30.5g-quickapp.conf
Normal file
@@ -0,0 +1,68 @@
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
listen 443 ssl http2 ;
|
||||
server_name xcx30.5g-quickapp.com;
|
||||
index index.php index.html index.htm default.php default.htm default.html;
|
||||
root /www/myweb/newshop;
|
||||
|
||||
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
|
||||
#error_page 404/404.html;
|
||||
ssl_certificate /www/server/panel/vhost/cert/xcx30.5g-quickapp.com/fullchain.pem;
|
||||
ssl_certificate_key /www/server/panel/vhost/cert/xcx30.5g-quickapp.com/privkey.pem;
|
||||
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 10m;
|
||||
add_header Strict-Transport-Security "max-age=31536000";
|
||||
error_page 497 https://$host$request_uri;
|
||||
|
||||
#SSL-END
|
||||
|
||||
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
|
||||
#error_page 404 /404.html;
|
||||
#error_page 502 /502.html;
|
||||
#ERROR-PAGE-END
|
||||
|
||||
#PHP-INFO-START PHP引用配置,可以注释或修改
|
||||
include enable-php-74.conf;
|
||||
#PHP-INFO-END
|
||||
|
||||
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
|
||||
# include /www/server/panel/vhost/rewrite/xcx30.5g-quickapp.com.conf; # 等于下面的内容
|
||||
location / {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /index.php/$1 last;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#REWRITE-END
|
||||
|
||||
#禁止访问的文件或目录
|
||||
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
|
||||
{
|
||||
return 404;
|
||||
}
|
||||
|
||||
#一键申请SSL证书验证目录相关设置
|
||||
location ~ \.well-known{
|
||||
allow all;
|
||||
}
|
||||
|
||||
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
|
||||
{
|
||||
expires 30d;
|
||||
error_log /dev/null;
|
||||
access_log /dev/null;
|
||||
}
|
||||
|
||||
location ~ .*\.(js|css)?$
|
||||
{
|
||||
expires 12h;
|
||||
error_log /dev/null;
|
||||
access_log /dev/null;
|
||||
}
|
||||
access_log /www/wwwlogs/xcx30.5g-quickapp.com.log;
|
||||
error_log /www/wwwlogs/xcx30.5g-quickapp.com.error.log;
|
||||
}
|
||||
Reference in New Issue
Block a user