Skip to content

A self-hosted media server and file management system

1.1 KB
Raw Blame
worker_processes  auto;

error_log  $NGINX_ERROR_LOG $LOG_OUTPUT_LEVEL;
pid        /var/run/nginx.pid;
daemon off;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    server_tokens $NGINX_SERVER_TOKENS;

    # set_real_ip_from caddy;
    real_ip_header X-Forwarded-For;

    log_format  custom  '$http_x_real_ip - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    map $request_uri $loggable {
        $HEALTHCHECK_PATH 0;
        ~^/up$ 0;
        ~^/(app|apps)/$ 0;
        default 1;
    }

    access_log  $NGINX_ACCESS_LOG custom if=$loggable;

    client_max_body_size $NGINX_CLIENT_MAX_BODY_SIZE;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    gzip on;
    gzip_static on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;

    include /etc/nginx/conf.d/*.conf;
}