docker-compose部署openresty
compose配置文件
services:
openresty:
image: harbor.bomsorte.com:1443/base/openresty:1.27.1.2
container_name: openresty
restart: always
ports:
- 80:80
- 443:443
volumes:
- /etc/localtime:/etc/localtime
- /data/openresty/conf.d:/etc/nginx/conf.d
- /data/openresty/logs:/usr/local/openresty/nginx/logs
networks:
- openresty
sysctls:
- net.core.somaxconn=50000
ulimits:
nproc: 50000
nofile:
soft: 5000000
hard: 5000000
networks:
openresty:
name: openrestyopenresty配置
user nobody;
worker_processes 8;
pcre_jit on;
events {
worker_connections 20000;
}
http {
include 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"';
lua_shared_dict limit 50m;
lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua";
init_by_lua_file "/usr/local/openresty/nginx/conf/waf/init.lua";
access_by_lua_file "/usr/local/openresty/nginx/conf/waf/access.lua";
access_log logs/access.log main;
client_body_temp_path /var/run/openresty/nginx-client-body;
proxy_temp_path /var/run/openresty/nginx-proxy;
fastcgi_temp_path /var/run/openresty/nginx-fastcgi;
uwsgi_temp_path /var/run/openresty/nginx-uwsgi;
scgi_temp_path /var/run/openresty/nginx-scgi;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_min_length 1k;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml text/javascript
application/json application/javascript application/xml
application/rss+xml image/svg+xml;
gzip_vary on;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
include /etc/nginx/conf.d/*.conf;
server_tokens off;
}
include /etc/nginx/conf.d/*.main;
- 感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 运维小白
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果

