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: openresty

openresty配置

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;