mirror of
https://github.com/hassio-addons/addon-glances.git
synced 2025-05-04 11:01:25 +00:00
63 lines
1.5 KiB
Nginx Configuration File
63 lines
1.5 KiB
Nginx Configuration File
worker_processes 1;
|
|
pid /var/run/nginx.pid;
|
|
error_log /dev/stdout info;
|
|
daemon off;
|
|
env HASSIO_TOKEN;
|
|
env DISABLE_HA_AUTHENTICATION;
|
|
load_module "/usr/lib/nginx/modules/ndk_http_module.so";
|
|
load_module "/usr/lib/nginx/modules/ngx_http_lua_module.so";
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
proxy_read_timeout 1200;
|
|
gzip on;
|
|
gzip_disable "msie6";
|
|
lua_shared_dict auths 16k;
|
|
resolver 172.30.32.2;
|
|
|
|
upstream glances {
|
|
ip_hash;
|
|
server 127.0.0.1:61209;
|
|
}
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 61208 default_server;
|
|
|
|
server_name _;
|
|
access_log /dev/stdout combined;
|
|
|
|
client_max_body_size 4G;
|
|
keepalive_timeout 5;
|
|
|
|
root /dev/null;
|
|
|
|
location / {
|
|
access_by_lua_file /etc/nginx/ha-auth.lua;
|
|
|
|
proxy_redirect off;
|
|
proxy_pass http://glances;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-NginX-Proxy true;
|
|
}
|
|
}
|
|
}
|