daemon off;
user root;
pid /var/run/nginx.pid;
worker_processes 1;
# Hass.io addon log
error_log /proc/1/fd/1 error;
events {
    worker_connections 1024;
}

http {
    include /etc/nginx/includes/mime.types;
    access_log stdout;
    default_type application/octet-stream;
    gzip on;
    keepalive_timeout 65;
    sendfile on;
    server_tokens off;

    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

    # Use Hass.io supervisor as resolver
    resolver 172.30.32.2;

    upstream esphome {
        server unix:/var/run/esphome.sock;
    }

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