If I visit hxxp://grafana.home.lan, I received a 110 connection timed out error on some assets which do not allow the application to work correctly, in this case, Grafana. Though, I will add this is not just happening with the Grafana service, it is happening to all the other services with assets.
nginx.1 | 2027/05/23 10:59:12 [error] 35#35: *267 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.1.238, server: grafana.home.lan, request: "GET /api/search?limit=30&starred=true HTTP/1.1", upstream: "http://192.168.160.5:3000/api/search?limit=30&starred=true", host: "grafana.home.lan", referrer: "http://grafana.home.lan/?chunkNotFound&orgId=1"
If I visit hxxp://grafana.home.lan:3000, the content loads with absolutely zero issues.
nginx.1 | grafana.home.lan 192.168.1.238 - - [23/May/2027:10:59:12 +0000] "GET /api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" "192.168.160.5:3000"
nginx-proxy docker-compose.yml
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy:latest
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./conf/proxy.conf:/etc/nginx/proxy.conf:ro
environment:
DEBUG: true
networks:
default:
name: nginx-proxy
external: true
Grafana config can be found here:
grafana:
image: grafana/grafana
environment:
VIRTUAL_HOST: grafana.home.lan
VIRTUAL_PORT: 3000
ports:
- 3000:3000
volumes:
- grafana-data:/var/lib/grafana
env_file:
- ./config/grafana.ini
expose:
- 3000
restart: unless-stopped
Generated nginx config:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 10240;
}
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;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
daemon off;
# configuration file /etc/nginx/mime.types:
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/avif avif;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.0.1-6-gc4ad18f
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
default upgrade;
'' close;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
# Set appropriate X-Forwarded-Ssl header based on $proxy_x_forwarded_proto
map $proxy_x_forwarded_proto $proxy_x_forwarded_ssl {
default off;
https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$upstream_addr"';
access_log off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
ssl_prefer_server_ciphers off;
error_log /dev/stderr;
resolver 127.0.0.11;
include /etc/nginx/proxy.conf;
server {
server_name _; # This is just an invalid value which will never trigger on a real hostname.
server_tokens off;
listen 80;
access_log /var/log/nginx/access.log vhost;
return 503;
}
# blackbox.home.lan
upstream blackbox.home.lan {
# Exposed ports: [{ 9115 9115 tcp 0.0.0.0}]
# Default virtual port: 9115
# VIRTUAL_PORT: 9115
## Can be connected with "nginx-proxy" network
# monitor-stack-blackbox_exporter-1
server 192.168.160.5:9115;
}
server {
server_name blackbox.home.lan;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://blackbox.home.lan;
}
}
# cadvisor.home.lan
upstream cadvisor.home.lan {
# Exposed ports: [{ 8080 8080 tcp 0.0.0.0}]
# Default virtual port: 8080
# VIRTUAL_PORT: 8080
## Can be connected with "nginx-proxy" network
# monitor-stack-cadvisor-1
server 192.168.160.3:8080;
}
server {
server_name cadvisor.home.lan;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://cadvisor.home.lan;
}
}
# grafana.home.lan
upstream grafana.home.lan {
# Exposed ports: [{ 3000 3000 tcp 0.0.0.0}]
# Default virtual port: 3000
# VIRTUAL_PORT: 3000
## Can be connected with "nginx-proxy" network
# monitor-stack-grafana-1
server 192.168.160.6:3000;
}
server {
server_name grafana.home.lan;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
include /etc/nginx/vhost.d/grafana.home.lan;
location / {
proxy_pass http://grafana.home.lan;
include /etc/nginx/vhost.d/grafana.home.lan_location;
}
}
# nodeexporter.home.lan
upstream nodeexporter.home.lan {
# Exposed ports: [{ 9100 9100 tcp 0.0.0.0}]
# Default virtual port: 9100
# VIRTUAL_PORT: 9100
## Can be connected with "nginx-proxy" network
# monitor-stack-node_exporter-1
server 192.168.160.7:9100;
}
server {
server_name nodeexporter.home.lan;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://nodeexporter.home.lan;
}
}
# piexporter.home.lan
upstream piexporter.home.lan {
# Exposed ports: [{ 9617 9617 tcp 0.0.0.0}]
# Default virtual port: 9617
# VIRTUAL_PORT: 9617
## Can be connected with "nginx-proxy" network
# monitor-stack-pihole_exporter-1
server 192.168.160.2:9617;
}
server {
server_name piexporter.home.lan;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://piexporter.home.lan;
}
}
# prometheus.local.lan
upstream prometheus.local.lan {
# Exposed ports: [{ 9090 9090 tcp 0.0.0.0}]
# Default virtual port: 9090
# VIRTUAL_PORT: 9090
## Can be connected with "nginx-proxy" network
# monitor-stack-prometheus-1
server 192.168.160.4:9090;
}
server {
server_name prometheus.local.lan;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://prometheus.local.lan;
}
}
# configuration file /etc/nginx/proxy.conf:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
proxy_connect_timeout 75s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_set_header Host $http_host;
# configuration file /etc/nginx/vhost.d/grafana.home.lan:
proxy_connect_timeout 75s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
location /api/live/ {
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_pass http://grafana.home.lan/;
}
# configuration file /etc/nginx/vhost.d/grafana.home.lan_location:
location /api/live/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_pass http://grafana;
}