# pangolin-edge 主配置(容器内 /etc/nginx/nginx.conf)。
# 官方 nginx 镜像已内置 stream 模块,无需 load_module。
user  nginx;
worker_processes  auto;
error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/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"';
    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    keepalive_timeout   65;
    types_hash_max_size 4096;

    # 默认站:未匹配域名的 80 兜底
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;
        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
    }

    # 业务 vhost(blog / jiu / marzban面板 / pay)—— 逐字移植现网
    include /etc/nginx/conf.d/*.conf;
}

# 443/TCP SNI 分流
include /etc/nginx/stream.conf;
