Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$CurrentContainer is null #355

Closed
multicast opened this issue Jul 31, 2021 · 9 comments · Fixed by #356
Closed

$CurrentContainer is null #355

multicast opened this issue Jul 31, 2021 · 9 comments · Fixed by #356

Comments

@multicast
Copy link

After a while I updated manually to :latest image from docker hub and all my containers ended up with upstream server 127.0.0.1 down;.

I copied nginx.tmpl, and after a while I found out {{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }} returns null, so this range can never set $server_found to true.

Change from $CurrentContainer.Networks to $container.Networks (from outer range) solved the problem.

I am running Debian Bullseye (daily dist-upgraded until Bullseye is stable), and docker-ce vevrsion 5:20.10.7~3-0~debian-bullseye from docker.com (i.e. not debian-packaged docker).

Can somebody confirm this behavior? I can make pull request.

@buchdag
Copy link
Member

buchdag commented Aug 2, 2021

Hi @multicast, this looks like it might be another instance of nginx-proxy/nginx-proxy#1529

Could you give me the output of those commands?

docker inspect yournginxproxycontainer
docker exec yournginxproxycontainer nginx -T
docker exec yournginxproxycontainer cat /proc/1/cpuset
docker exec yournginxproxycontainer cat /proc/self/cgroup
docker exec yournginxproxycontainer cat /proc/self/mountinfo

@multicast
Copy link
Author

Hi @buchdag, I also found your comment nginx-proxy/nginx-proxy#1586 (comment) and went through referenced issues, but had no time to finish analysis or patch on getting container id.

I tried to understood how the where in the template works, but so far it fails for me and returns null, despite there is a container in $ with ID attribute in .Docker.CurrentContainerID.

Here is the output of commands. The first nginx is using $CurrentContainer.Networks, and does not work, the second uses $container.Networks and works well:

# 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/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:
# .Docker {"Name":"debian","NumContainers":15,"NumImages":697,"Version":"20.10.7","ApiVersion":"1.41","GoVersion":"go1.13.15","OperatingSystem":"linux","Architecture":"amd64","CurrentContainerID":"a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223"}
# $CurrentContainer null
#
# 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;
resolver 127.0.0.11;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
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 $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
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;
}
server {
	server_name _; # This is just an invalid value which will never trigger on a real hostname.
	server_tokens off;
	listen 443 ssl http2;
	access_log /var/log/nginx/access.log vhost;
	return 503;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/default.crt;
	ssl_certificate_key /etc/nginx/certs/default.key;
}
# drone.redacted
upstream drone.redacted-upstream {
	# Exposed ports: [{   80 49153 tcp 0.0.0.0} {   443  tcp }]
	# Default virtual port: 80
	# VIRTUAL_PORT: 80
	# Fallback entry
	server 127.0.0.1 down;
}
server {
	server_name drone.redacted;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location ^~ /.well-known/acme-challenge/ {
		auth_basic off;
		auth_request off;
		allow all;
		root /usr/share/nginx/html;
		try_files $uri =404;
		break;
	}
	location / {
		return 301 https://$host$request_uri;
	}
}
server {
	server_name drone.redacted;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	ssl_session_timeout 5m;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/drone.redacted.crt;
	ssl_certificate_key /etc/nginx/certs/drone.redacted.key;
	ssl_dhparam /etc/nginx/certs/drone.redacted.dhparam.pem;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_trusted_certificate /etc/nginx/certs/drone.redacted.chain.pem;
	add_header Strict-Transport-Security "max-age=31536000" always;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://drone.redacted-upstream;
	}
}
# filez.redacted
upstream filez.redacted-upstream {
	# Exposed ports: [{   80 49154 tcp 0.0.0.0}]
	# Default virtual port: 80
	# VIRTUAL_PORT: 80
	# Fallback entry
	server 127.0.0.1 down;
}
server {
	server_name filez.redacted;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location ^~ /.well-known/acme-challenge/ {
		auth_basic off;
		auth_request off;
		allow all;
		root /usr/share/nginx/html;
		try_files $uri =404;
		break;
	}
	location / {
		return 301 https://$host$request_uri;
	}
}
server {
	server_name filez.redacted;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	ssl_session_timeout 5m;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/filez.redacted.crt;
	ssl_certificate_key /etc/nginx/certs/filez.redacted.key;
	ssl_dhparam /etc/nginx/certs/filez.redacted.dhparam.pem;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_trusted_certificate /etc/nginx/certs/filez.redacted.chain.pem;
	add_header Strict-Transport-Security "max-age=31536000" always;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://filez.redacted-upstream;
	}
}
# git.redacted
upstream git.redacted-upstream {
	# Exposed ports: [{   42 42 tcp 0.0.0.0} {   8443 49156 tcp 0.0.0.0} {   22  tcp } {   3000  tcp }]
	# Default virtual port: 80
	# VIRTUAL_PORT: 8443
	# Fallback entry
	server 127.0.0.1 down;
}
server {
	server_name git.redacted;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location ^~ /.well-known/acme-challenge/ {
		auth_basic off;
		auth_request off;
		allow all;
		root /usr/share/nginx/html;
		try_files $uri =404;
		break;
	}
	location / {
		return 301 https://$host$request_uri;
	}
}
server {
	server_name git.redacted;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	ssl_session_timeout 5m;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/git.redacted.crt;
	ssl_certificate_key /etc/nginx/certs/git.redacted.key;
	ssl_dhparam /etc/nginx/certs/git.redacted.dhparam.pem;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_trusted_certificate /etc/nginx/certs/git.redacted.chain.pem;
	add_header Strict-Transport-Security "max-age=31536000" always;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://git.redacted-upstream;
	}
}

# configuration file /etc/nginx/vhost.d/default:
## Start of configuration add by letsencrypt container
location ^~ /.well-known/acme-challenge/ {
    auth_basic off;
    auth_request off;
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
## End of configuration add by letsencrypt container

nginx -T with my change to $container.Networks works:

# 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/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:
# .Docker {"Name":"debian","NumContainers":15,"NumImages":697,"Version":"20.10.7","ApiVersion":"1.41","GoVersion":"go1.13.15","OperatingSystem":"linux","Architecture":"amd64","CurrentContainerID":"a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223"}
# $CurrentContainer null
#
# 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;
resolver 127.0.0.11;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
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 $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
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;
}
server {
	server_name _; # This is just an invalid value which will never trigger on a real hostname.
	server_tokens off;
	listen 443 ssl http2;
	access_log /var/log/nginx/access.log vhost;
	return 503;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/default.crt;
	ssl_certificate_key /etc/nginx/certs/default.key;
}
# drone.redacted
upstream drone.redacted-upstream {
	# Exposed ports: [{   443  tcp } {   80 49153 tcp 0.0.0.0}]
	# Default virtual port: 80
	# VIRTUAL_PORT: 80
	## Can be connected with "root_local" network
	# root_drone_1
	server 172.22.2.6:80;
}
server {
	server_name drone.redacted;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location ^~ /.well-known/acme-challenge/ {
		auth_basic off;
		auth_request off;
		allow all;
		root /usr/share/nginx/html;
		try_files $uri =404;
		break;
	}
	location / {
		return 301 https://$host$request_uri;
	}
}
server {
	server_name drone.redacted;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	ssl_session_timeout 5m;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/drone.redacted.crt;
	ssl_certificate_key /etc/nginx/certs/drone.redacted.key;
	ssl_dhparam /etc/nginx/certs/drone.redacted.dhparam.pem;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_trusted_certificate /etc/nginx/certs/drone.redacted.chain.pem;
	add_header Strict-Transport-Security "max-age=31536000" always;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://drone.redacted-upstream;
	}
}
# filez.redacted
upstream filez.redacted-upstream {
	# Exposed ports: [{   80 49154 tcp 0.0.0.0}]
	# Default virtual port: 80
	# VIRTUAL_PORT: 80
	## Can be connected with "root_local" network
	# root_filez_1
	server 172.22.2.33:80;
}
server {
	server_name filez.redacted;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location ^~ /.well-known/acme-challenge/ {
		auth_basic off;
		auth_request off;
		allow all;
		root /usr/share/nginx/html;
		try_files $uri =404;
		break;
	}
	location / {
		return 301 https://$host$request_uri;
	}
}
server {
	server_name filez.redacted;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	ssl_session_timeout 5m;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/filez.redacted.crt;
	ssl_certificate_key /etc/nginx/certs/filez.redacted.key;
	ssl_dhparam /etc/nginx/certs/filez.redacted.dhparam.pem;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_trusted_certificate /etc/nginx/certs/filez.redacted.chain.pem;
	add_header Strict-Transport-Security "max-age=31536000" always;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://filez.redacted-upstream;
	}
}
# git.redacted
upstream git.redacted-upstream {
	# Exposed ports: [{   22  tcp } {   3000  tcp } {   42 42 tcp 0.0.0.0} {   8443 49156 tcp 0.0.0.0}]
	# Default virtual port: 80
	# VIRTUAL_PORT: 8443
	## Can be connected with "root_local" network
	# root_git_1
	server 172.22.2.3:8443;
}
server {
	server_name git.redacted;
	listen 80 ;
	access_log /var/log/nginx/access.log vhost;
	# Do not HTTPS redirect Let'sEncrypt ACME challenge
	location ^~ /.well-known/acme-challenge/ {
		auth_basic off;
		auth_request off;
		allow all;
		root /usr/share/nginx/html;
		try_files $uri =404;
		break;
	}
	location / {
		return 301 https://$host$request_uri;
	}
}
server {
	server_name git.redacted;
	listen 443 ssl http2 ;
	access_log /var/log/nginx/access.log vhost;
	ssl_session_timeout 5m;
	ssl_session_cache shared:SSL:50m;
	ssl_session_tickets off;
	ssl_certificate /etc/nginx/certs/git.redacted.crt;
	ssl_certificate_key /etc/nginx/certs/git.redacted.key;
	ssl_dhparam /etc/nginx/certs/git.redacted.dhparam.pem;
	ssl_stapling on;
	ssl_stapling_verify on;
	ssl_trusted_certificate /etc/nginx/certs/git.redacted.chain.pem;
	add_header Strict-Transport-Security "max-age=31536000" always;
	include /etc/nginx/vhost.d/default;
	location / {
		proxy_pass http://git.redacted-upstream;
	}
}

# configuration file /etc/nginx/vhost.d/default:
## Start of configuration add by letsencrypt container
location ^~ /.well-known/acme-challenge/ {
    auth_basic off;
    auth_request off;
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
## End of configuration add by letsencrypt container

cpuset:

/

cgroup:

0::/

mountinfo:

1807 1466 0:59 / / rw,relatime master:152 - overlay overlay rw,lowerdir=/var/lib/docker/overlay2/l/Y6YK72XFFP5I637S37UKYBIZVR:/var/lib/docker/overlay2/l/KCFBYQ3KU6WHKN2LQEQAWBXI5Z:/var/lib/docker/overlay2/l/GPIKOGJNZRIPJL2GINJQN7WJ6P:/var/lib/docker/overlay2/l/ZIM3YY6IQDCPZDK5P7HLPBHHRE:/var/lib/docker/overlay2/l/3TMZGJJTTTBEWKPUKCWRIMEC6H:/var/lib/docker/overlay2/l/XVOQ3B3T3SNN3H4V2YGP6UUVDR:/var/lib/docker/overlay2/l/2SMGBB2UXRYEOIKFVSBSCDOXPI:/var/lib/docker/overlay2/l/A45ERK4DZGTQZRCWHB7Z2WRGPA:/var/lib/docker/overlay2/l/M3KWC76RDCER6PFT4R27TUWLNG:/var/lib/docker/overlay2/l/I4Z6PDERRH6JXNKDVFG3F2LX2Q:/var/lib/docker/overlay2/l/N7VZ5MNAHK22FBWMLLZJCCT3YN:/var/lib/docker/overlay2/l/SENPBDKLPUZ6JCKKDWFE3AS7A5:/var/lib/docker/overlay2/l/CEWKSCH4UDJCDF5MUQZYJQW75O,upperdir=/var/lib/docker/overlay2/a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223/diff,workdir=/var/lib/docker/overlay2/a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223/work
1808 1807 0:143 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
1809 1807 0:144 / /dev rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755
1810 1809 0:145 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=666
1811 1807 0:146 / /sys ro,nosuid,nodev,noexec,relatime - sysfs sysfs ro
1812 1811 0:27 / /sys/fs/cgroup ro,nosuid,nodev,noexec,relatime - cgroup2 cgroup rw,nsdelegate,memory_recursiveprot
1813 1809 0:142 / /dev/mqueue rw,nosuid,nodev,noexec,relatime - mqueue mqueue rw
1814 1809 0:147 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw,size=65536k
1815 1807 253:11 /proxy/nginx.tmpl /app/nginx.tmpl rw,noatime,nodiratime - ext4 /dev/mapper/nvme-volumes rw,nobarrier
1816 1807 0:23 /docker.sock /tmp/docker.sock ro,relatime - tmpfs tmpfs rw,size=6585272k,mode=755
1817 1807 0:34 /volumes/varlib-docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/hosts /etc/hosts rw,nosuid,noatime,nodiratime - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1818 1807 0:34 /volumes/varlib-docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/resolv.conf /etc/resolv.conf rw,nosuid,noatime,nodiratime - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1819 1807 0:34 /volumes/varlib-docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/hostname /etc/hostname rw,nosuid,noatime,nodiratime - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1820 1807 0:34 /volumes/varlib-docker/volumes/c6842cee10b7917a583a621897f429090a1d4826cfbcc2165cbc1fe6257fd0cc/_data /etc/nginx/dhparam rw,nosuid,noatime,nodiratime master:56 - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1821 1807 0:34 /volumes/varlib-docker/volumes/root_proxy_vhosts/_data /etc/nginx/vhost.d rw,nosuid,noatime,nodiratime master:56 - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1822 1807 0:34 /volumes/varlib-docker/volumes/root_proxy_certs/_data /etc/nginx/certs ro,noatime,nodiratime master:56 - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1823 1807 0:34 /volumes/varlib-docker/volumes/root_proxy_html/_data /usr/share/nginx/html rw,nosuid,noatime,nodiratime master:56 - btrfs /dev/mapper/nvme-home rw,nobarrier,space_cache,commit=600,subvolid=612,subvol=/volumes/varlib-docker
1467 1808 0:143 /bus /proc/bus ro,nosuid,nodev,noexec,relatime - proc proc rw
1468 1808 0:143 /fs /proc/fs ro,nosuid,nodev,noexec,relatime - proc proc rw
1469 1808 0:143 /irq /proc/irq ro,nosuid,nodev,noexec,relatime - proc proc rw
1470 1808 0:143 /sys /proc/sys ro,nosuid,nodev,noexec,relatime - proc proc rw
1471 1808 0:143 /sysrq-trigger /proc/sysrq-trigger ro,nosuid,nodev,noexec,relatime - proc proc rw
1472 1808 0:181 / /proc/asound ro,relatime - tmpfs tmpfs ro
1473 1808 0:182 / /proc/acpi ro,relatime - tmpfs tmpfs ro
1474 1808 0:144 /null /proc/kcore rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755
1475 1808 0:144 /null /proc/keys rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755
1476 1808 0:144 /null /proc/timer_list rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755
1477 1808 0:144 /null /proc/sched_debug rw,nosuid - tmpfs tmpfs rw,size=65536k,mode=755
1478 1811 0:183 / /sys/firmware ro,relatime - tmpfs tmpfs ro

@multicast
Copy link
Author

The inspect was lost in paste:

[
    {
        "Id": "f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92",
        "Created": "2021-07-29T06:00:11.602901712Z",
        "Path": "/app/docker-entrypoint.sh",
        "Args": [
            "forego",
            "start",
            "-r"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 5485,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2021-08-03T10:46:25.479338463Z",
            "FinishedAt": "2021-08-03T10:45:11.158471932Z"
        },
        "Image": "sha256:a333f0eeb78a98b5e0a1c978d0ca1ecfd10df81a8e0014510a9d21ddbcba0448",
        "ResolvConfPath": "/var/lib/docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/hostname",
        "HostsPath": "/var/lib/docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/hosts",
        "LogPath": "/var/lib/docker/containers/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92/f08869459f5e53b8a956c14da7c2f4f4451d18f8efecf86fe08358b6a66d3a92-json.log",
        "Name": "/root_proxy_1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "docker-default",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "root_proxy_html:/usr/share/nginx/html:rw",
                "/srv/volumes/proxy/nginx.tmpl:/app/nginx.tmpl:rw",
                "root_proxy_vhosts:/etc/nginx/vhost.d:rw",
                "root_proxy_certs:/etc/nginx/certs:ro",
                "/run/docker.sock:/tmp/docker.sock:ro"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {
                    "max-file": "10",
                    "max-size": "1m"
                }
            },
            "NetworkMode": "root_local",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "private",
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223-init/diff:/var/lib/docker/overlay2/762c826cee4cad3a522c0d17778e2444828fbae6821f5c5221a577ffa8bc3018/diff:/var/lib/docker/overlay2/4ad0e3abdcb43ac7e4f49fd9458e12b45abe871ef6e6c444088d4c5ba370ad8b/diff:/var/lib/docker/overlay2/64e2b8baac644117587ce386202ea1b687c5ba3a8f20f8d9220fe5b94cec6ae6/diff:/var/lib/docker/overlay2/b96359c9830230013ae04a45dad83c4b206d4e937db971c575676f921f41117f/diff:/var/lib/docker/overlay2/604165230db0fc740d20e4135d4c008e83aa6f63d0a2edfb46fff8b15375ca4f/diff:/var/lib/docker/overlay2/9ede3e04374a0d93c4009f9505fe8d16bce238e5a8fa36456f88d99965a4e43b/diff:/var/lib/docker/overlay2/e23c3281137f0be337fd99c34e35a6cff5da62615d29f55a950da467430788dc/diff:/var/lib/docker/overlay2/9591d81cc030af1ffa3661aeb0ccd6ac78146645fff427856bad1ab6ab8844c8/diff:/var/lib/docker/overlay2/f5fc4826f7b562ab2b2e0c590b4b0388ae07e4462369c6e576965da8942f056d/diff:/var/lib/docker/overlay2/3264934b20c365d966cc2e41c229220adac54a839ccefd1bed3afdf92afa4901/diff:/var/lib/docker/overlay2/5d26d6271f7aaa66dd5537f34689cb97245c983b4ebccb96f5342efc3bcaab46/diff:/var/lib/docker/overlay2/7ec39356ad88835e5ffb18ccd8cdf7ff2e59d5e1042659ae6549f9fa770b726e/diff",
                "MergedDir": "/var/lib/docker/overlay2/a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223/merged",
                "UpperDir": "/var/lib/docker/overlay2/a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223/diff",
                "WorkDir": "/var/lib/docker/overlay2/a70d4a9f719a44d476ccd07ae708333e7e42151cae5d94d5cd57633b9dcd0223/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/srv/volumes/proxy/nginx.tmpl",
                "Destination": "/app/nginx.tmpl",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "root_proxy_certs",
                "Source": "/var/lib/docker/volumes/root_proxy_certs/_data",
                "Destination": "/etc/nginx/certs",
                "Driver": "local",
                "Mode": "ro",
                "RW": false,
                "Propagation": ""
            },
            {
                "Type": "volume",
                "Name": "c6842cee10b7917a583a621897f429090a1d4826cfbcc2165cbc1fe6257fd0cc",
                "Source": "/var/lib/docker/volumes/c6842cee10b7917a583a621897f429090a1d4826cfbcc2165cbc1fe6257fd0cc/_data",
                "Destination": "/etc/nginx/dhparam",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "volume",
                "Name": "root_proxy_vhosts",
                "Source": "/var/lib/docker/volumes/root_proxy_vhosts/_data",
                "Destination": "/etc/nginx/vhost.d",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "bind",
                "Source": "/run/docker.sock",
                "Destination": "/tmp/docker.sock",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "root_proxy_html",
                "Source": "/var/lib/docker/volumes/root_proxy_html/_data",
                "Destination": "/usr/share/nginx/html",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "proxy",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "DEBUG=true",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NGINX_VERSION=1.21.1",
                "NJS_VERSION=0.6.1",
                "PKG_RELEASE=1~buster",
                "DOCKER_GEN_VERSION=0.7.6",
                "DOCKER_HOST=unix:///tmp/docker.sock"
            ],
            "Cmd": [
                "forego",
                "start",
                "-r"
            ],
            "Image": "jwilder/nginx-proxy:latest",
            "Volumes": {
                "/app/nginx.tmpl": {},
                "/etc/nginx/certs": {},
                "/etc/nginx/dhparam": {},
                "/etc/nginx/vhost.d": {},
                "/tmp/docker.sock": {},
                "/usr/share/nginx/html": {}
            },
            "WorkingDir": "/app",
            "Entrypoint": [
                "/app/docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "1e420c7e0393e7c6064dfc3b1cd60be5916d49ca4355150209758ef5b7a212e8",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "root",
                "com.docker.compose.project.config_files": "docker-compose.yml",
                "com.docker.compose.project.working_dir": "/root/compose",
                "com.docker.compose.service": "proxy",
                "com.docker.compose.version": "1.29.2",
                "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy": "",
                "maintainer": "Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag)",
                "org.opencontainers.image.created": "2021-07-26T00:01:22.628Z",
                "org.opencontainers.image.description": "Automated nginx proxy for Docker containers using docker-gen",
                "org.opencontainers.image.licenses": "MIT",
                "org.opencontainers.image.revision": "4e3e518936d27d22e5e5e5552d41097d11bb727c",
                "org.opencontainers.image.source": "https://github.com/nginx-proxy/nginx-proxy",
                "org.opencontainers.image.title": "nginx-proxy",
                "org.opencontainers.image.url": "https://github.com/nginx-proxy/nginx-proxy",
                "org.opencontainers.image.version": "latest"
            },
            "StopSignal": "SIGQUIT"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "0ac2052dbabd0b52d717114776fdd14c21c16cd1a0b8e70af7bfe32c89a1ffad",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "80/tcp": null
            },
            "SandboxKey": "/var/run/docker/netns/0ac2052dbabd",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "root_local": {
                    "IPAMConfig": {
                        "IPv4Address": "172.22.2.65"
                    },
                    "Links": null,
                    "Aliases": [
                        "f08869459f5e",
                        "proxy"
                    ],
                    "NetworkID": "b7c9611e00dd74a645063ea79923d174aa57e76f285750a49f3af6eba9c51a4c",
                    "EndpointID": "3e62e64c905e0269c76ca1a6dcd58ea9b5828e4d0ef94c9b6493d12e559f0e15",
                    "Gateway": "172.22.2.1",
                    "IPAddress": "172.22.2.65",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:16:02:41",
                    "DriverOpts": null
                },
                "root_macvlan": {
                    "IPAMConfig": {
                        "IPv4Address": "192.168.88.65"
                    },
                    "Links": null,
                    "Aliases": [
                        "f08869459f5e",
                        "proxy"
                    ],
                    "NetworkID": "f06aff2175b7edd46947615a614f4eb87273a5cabd6af795b1eb98e5eb3ee7d0",
                    "EndpointID": "cd3820f77d94a80fd14080801901fe9618e9ef59244d55e5616c41ceeb929c12",
                    "Gateway": "192.168.88.1",
                    "IPAddress": "192.168.88.65",
                    "IPPrefixLen": 24,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:c0:a8:58:41",
                    "DriverOpts": null
                }
            }
        }
    }
]

@buchdag
Copy link
Member

buchdag commented Aug 3, 2021

@multicast I confirm this is another instance of a docker-gen issue we already encountered and fixed multiple time.

See #335, #336 and #345

Short version is there is no clear and stable mechanism to get the ID of a container from inside the container itself. At the moment docker-gen tries to extract the 64 characters container ID from a set of three files. In your case the first two (/proc/1/cpuset and /proc/self/cgroup) are empty, so it tries /proc/self/mountinfo but matches the first 64 character ID it finds, which is not your container ID.

I'm transferring this issue to nginxproxy/docker-gen.

@buchdag buchdag transferred this issue from nginx-proxy/nginx-proxy Aug 3, 2021
@buchdag
Copy link
Member

buchdag commented Aug 3, 2021

Removing the custom hostname (proxy) and using a container name instead might be a quick fix.

@multicast
Copy link
Author

Removing the custom hostname fixed the problem, thanks.

@buchdag
Copy link
Member

buchdag commented Aug 3, 2021

@multicast I pushed a version of nginx-proxy built with a patched docker-gen, can you tell me if it works for you even with the custom hostname ?

docker pull nginxproxy/nginx-proxy:dg355

@multicast
Copy link
Author

Yes, I was checking :latest an hour after you merged, but still had to change the hostname.
The containers/ prefix in the regex works when using custom hostname, awesome.

@buchdag
Copy link
Member

buchdag commented Aug 4, 2021

@multicast the fix is now available in nginxproxy/nginx-proxy:latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants