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

cannot load certificate, Expecting: TRUSTED CERTIFICATE #2287

Closed
djuarezg opened this issue Aug 18, 2023 · 37 comments · Fixed by #2520 or pixelfed/pixelfed#5435
Closed

cannot load certificate, Expecting: TRUSTED CERTIFICATE #2287

djuarezg opened this issue Aug 18, 2023 · 37 comments · Fixed by #2520 or pixelfed/pixelfed#5435

Comments

@djuarezg
Copy link

djuarezg commented Aug 18, 2023

Cannot run HTTPS on the 1.3.1 image due to the following startup error:

nginx-proxy_1  | nginx.1     | 2023/08/18 15:59:31 [error] 46#46: *1 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: <IP>, server: 0.0.0.0:8881

This is the Docker compose to reproduce it:

version: '2'

services:
  nginx-proxy:
    image: nginxproxy/nginx-proxy:1.3.1
    network_mode: "host"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /tmp/nginx:/etc/nginx/conf.d
      - /etc/pki/tls/certs/:/etc/nginx/certs/:ro
    environment:
      - HTTP_PORT=8879
      - HTTPS_PORT=8881


  whoami:
    image: jwilder/whoami
    network_mode: "host"
    environment:
      - VIRTUAL_HOST=dtapi.domain.com
      - VIRTUAL_PORT=8000
      - VIRTUAL_PATH=/whoami

  # Sample hello world web service serving on port 8001
  hello:
    image: tutum/hello-world
    network_mode: "host"
    environment:
      - VIRTUAL_HOST=dtapi.domain.com
      - VIRTUAL_PORT=80
      - VIRTUAL_PATH=/hello

For reference these are the crt and key files (REDACTED):

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            <REDACTED>
        Signature Algorithm: sha512WithRSAEncryption
        Issuer: CN=<REDACTED>
        Validity
            Not Before: Sep 13 10:23:24 2022 GMT
            Not After : Aug 28 10:23:24 2025 GMT
        Subject: CN=vmk-dtapi-01
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
                Modulus:<REDACTED>
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Subject Key Identifier:
                <REDACTED>
            X509v3 Authority Key Identifier:
                keyid: <REDACTED>
                DirName:/CN=<REDACTED>
                serial:<REDACTED>

            X509v3 Extended Key Usage:
                TLS Web Server Authentication
            X509v3 Key Usage:
                Digital Signature, Key Encipherment
            X509v3 Subject Alternative Name:
                DNS:vmk-dtapi-01, DNS:vmk-dtapi-01.domain.com, IP Address:
    Signature Algorithm: sha512WithRSAEncryption
-----BEGIN CERTIFICATE-----
<REDACTED>
-----END CERTIFICATE-----
-----BEGIN PRIVATE KEY-----
REDACTED
-----END PRIVATE KEY-----

Tried using a crt file produced with openssl x509 -in dtapi.domain.com.crt --trustout -out dtapi.domain.com.crt without any change of output.

@lemzoo
Copy link

lemzoo commented Aug 21, 2023

Hello, I encounter currently the same issue

2023/08/21 15:31:51 [error] 40#40: *22 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 10.170.78.215, server: 0.0.0.0:443

@lemzoo
Copy link

lemzoo commented Aug 21, 2023

I tested some images and I found all the new images build after this 1.2-alpine didn't works.
And all the image with the oldest tag works as expected

@jordonedavidson
Copy link

jordonedavidson commented Aug 22, 2023

Can confirm that release 1.3.1 has this behaviour, while release 1.3.0 does not.

-- Correction --
1.3.0 still throws the error periodically in the logs but does not seem to prevent the loading of the secured site.

@djuarezg
Copy link
Author

Found a workaround, which does not correspond to what the README states. If you name the crt and key files as "default.crt" or "default.key" as per https://github.com/nginx-proxy/nginx-proxy/blob/main/nginx.tmpl#L14C77-L14C77, it seems to work fine with the latest version.

So, either fix the template or update the README.

@icsy7867
Copy link

icsy7867 commented Oct 6, 2023

I ran into this as well. Creating a default.crt and default.key fixed the issue.

@jmvallejo
Copy link

Would this solution still support multiple virtual hosts with ssl? What's the latest version that doesn't have the issue? I'm running into the same problem, thanks!

@osnard
Copy link

osnard commented Dec 21, 2023

I have the same issue with the latest version. Unfortunately using the default.pem name approach didn't work for me.

@osnard
Copy link

osnard commented Dec 22, 2023

HINT: Apparently I did something wrong in the first place. With

openssl req -x509 -newkey rsa:4096 -keyout <hostname>.key -out <hostname>.crt -sha256 -days 3650 -nodes -subj "/C=...ST=.../L=.../O=.../OU=.../CN=..."

it worked.

@buchdag
Copy link
Member

buchdag commented Dec 23, 2023

I've been unable to reproduce this, I've never had the issue with Let's Encrypt or ZeroSSL certificates, and I'm not certain what the issue is here. This error (PEM_read_bio_X509_AUX() failed) is OpenSSL telling you it can't read what should be a valid certificate file (valid in the sense encoded as expected by OpenSSL). Having or not having a default certificate should have no effect on wether OpenSSL can or cannot read another certificate 🤔

@osnard do you remember what command you used in the first place to produce the non working cert ?

@ortiz-kuakside
Copy link

hi all , using version 1.3.0 worked

@cicnavi
Copy link

cicnavi commented Dec 30, 2023

I've encountered the same error while trying to use regular expression in the host together with wildcard certificate, with example compose file being below.

So, if I tried to enter a non-regular expression host (for example latest-dap.localhost.markoivancic.from.hr), it worked. If I tried to enter regular expression host (for example abc-latest-dap.localhost.markoivancic.from.hr), ti would error out with "Expecting: TRUSTED CERTIFICATE".

The solution which worked for me was to explicitly set the shared cert with CERT_NAME environment variable.

services:
    nginx-proxy:
        restart: always
        image: nginxproxy/nginx-proxy:latest
        ports:
            - 80:80
            - 443:443
        environment:
            DEFAULT_HOST: localhost.markoivancic.from.hr
        volumes:
            - ./nginx-proxy/certs:/etc/nginx/certs
            - /var/run/docker.sock:/tmp/docker.sock:ro

    08.dap.test:
        image: cicnavi/dap:08
        container_name: 08.dap.test
        restart: unless-stopped
        expose:
            - 80
            - 443
        user: ${CONTAINER_USER_ID}
        environment:
            VIRTUAL_HOST: >-
                localhost.markoivancic.from.hr,
                08.dap.test,
                latest-dap.localhost.markoivancic.from.hr,
                ~^.+-latest-dap\.localhost\.markoivancic\.from\.hr$,
                08-dap.localhost.markoivancic.from.hr,
                ~^.+-08-dap\.localhost\.markoivancic\.from\.hr$
            CERT_NAME: localhost.markoivancic.from.hr
            HTTPS_METHOD: noredirect
        volumes:
            - "./dap/08/html:/var/www/html"

@pkimtani
Copy link

I generated my self-signed certificate using mkcert, and I was facing the same issue (running version 1.4-alpine). I created a copy of the same crt and key files and renamed them to default.crt and default.key and everything started to work.

@postelrich
Copy link

Was there a resolution to this? Seeing

nginx.1     | 2024/03/10 04:48:37 [error] 509#509: *101 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 192.168.86.170, server: 0.0.0.0:443

with nginx-proxy:1.4. The certs are generated with certbot on the host machine and volume mapped with container.

sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials ~/.cloudflare.ini -d example.com -d *.example.com --rsa-key-size 2048 --key-type rsa

@buchdag
Copy link
Member

buchdag commented Mar 12, 2024

@postelrich unfortunately there wasn't really any reproducible bug identified yet, see #2287 (comment)

That probably won't change until someone provide a config and a non redacted, non production and disposable cert / key pair (or full command to generate one) that allow to reproduce the issue.

@postelrich
Copy link

@buchdag after looking further, my issue is that nginx-proxy is not picking up the ssl cert/key no matter what naming I try. If exec into the container, I can see the ssl configs are missing. If I manually add them in for the upstream server, it works.

@buchdag
Copy link
Member

buchdag commented Mar 13, 2024

Could you:

  • post your full nginx-proxy and proxied app configuration (compose file or equivalent)
  • post the result of docker exec yourproxycontainer ls -lh /etc/nginx/certs
  • check if you can cat those certificates from inside the container (I'd say yes if manually adding them to the nginx config worked)

?

My guess at this point would be that you are mounting a host symlink inside the container.

@postelrich
Copy link

@buchdag it was a symlink since I'm using certbot. I think in my various attempts to get this working, I forgot that when I hardcoded I had mounted the linked directory too. Copying the generated pem files instead of symlinking to example.com.crt and example.com.key worked as expected. Thanks for the reminder.

@buchdag
Copy link
Member

buchdag commented Mar 13, 2024

Glad you found the issue 👍

If I had to use certbot with nginx-proxy I think I would use the post renewal hook to put the certificates where they should be (with the correct name) and trigger docker-gen and/or reload the nginx config.

The recommended way to get TLS certificate from an ACME CA with nginx-proxy is still to use nginx-proxy/acme-companion.

@postelrich
Copy link

@buchdag yea I tried acme-companion first but these sites are LAN only so couldn't do http challenge.

@jordonedavidson
Copy link

jordonedavidson commented Apr 16, 2024

I'm wondering if the network mode is part of the problem. In the original issue the network mode is host, which I believe binds the container to the host machine's IP address. I'm having a similar issue when using the driver_opts key in my networks definition where I have this:

networks:
  app-tier:
    ipam:
      config:
        - subnet: 192.168.100.0/24
    driver_opts:
      # This binds this network's ports to the ip address defined by the BIND_IP
      # environment variable.
      com.docker.network.bridge.host_binding_ipv4: ${BIND_IP}

The error in the logs shows that the proxy server upstream cannot get the value of "data(): 0.0.0.0:443" or something similar. The cert is included in the container in the appropriate location. Maybe this is something to check out?

I have nearly identical setups in local and testing setups, with this binding being the main difference. Only this setup produces the errors. Note i'm currently using version 1.5.1

@r14c
Copy link

r14c commented Jul 11, 2024

I was able to resolve this issue using the default.crt,key method mentioned up thread, but I would like to understand the actual cause of the problem.

@jokiefer
Copy link

as @r14c recommended. I also used the default.crt,key workaround with the following docker-compose. It seems that the CERT_NAME env is ignored.

version: '3.8'
services:

  nginx:
    image: nginxproxy/nginx-proxy:1.5-alpine
    volumes:
      - ./certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro 
    restart: unless-stopped
    ports: 
      - 80:80
      - 443:443
    networks:
      mgmt-vlan:
        ipv4_address: 10.0.10.225

  home-assistant:
    image: homeassistant/home-assistant:2024.3
    volumes:
      - ./homeassistant-config/config:/config
    environment:
      - VIRTUAL_HOST=home.something.com
      - CERT_NAME=home.something.com
    restart: unless-stopped
    ports:
      - 8123:8123
    networks:
      mgmt-vlan:
        ipv4_address: 10.0.10.226

  traccar:
    image: traccar/traccar:6.2-alpine
    volumes:
      - ./traccar/logs:/opt/traccar/logs:rw
      - ./traccar/traccar.xml:/opt/traccar/conf/traccar.xml:ro
      - ./traccar/data:/opt/traccar/data:rw
    environment:
      #- VIRTUAL_HOST=traccar.something.com
      - CERT_NAME=traccar.something.com
      - |
        VIRTUAL_HOST_MULTIPORTS=
          {
           "traccar.something.com": {
            "/": { "port": 8082, "dest", ""},
            "/osmand": { "port": 5055, "dest", "/"}
           }
          }
      - CERT_NAME=traccer.something.com
    restart: unless-stopped
    ports:
      - 80:8082
      - 5055:5055
     # - 5000-5150:5000-5150/udp
    networks:
      mgmt-vlan:
        ipv4_address: 10.0.10.227
    depends_on:
      - traccar-db

  traccar-db:
    image: postgres:16.3-alpine3.20
    volumes:
      - type: volume
        source: traccar-db-data
        target: /var/lib/postgresql/data
    networks:
      mgmt-vlan:
        ipv4_address: 10.0.10.228
    environment:
      POSTGRES_USER: traccar
      POSTGRES_PASSWORD: traccar
      POSTGRES_DB: traccar

volumes:
  ho-db-data: null
  traccar-db-data: null

networks:
  mgmt-vlan:
    driver: macvlan
    driver_opts:
      parent: br-mgmtdocker
    ipam:
      config:
        - subnet: 10.0.10.224/28
          gateway: 10.0.10.238

@underblob
Copy link

underblob commented Aug 15, 2024

Hi, I am using mkcert on MacOS to generate multiple development certificates for different projects that run locally.

Go to the Docker Desktop Terminal on the nginx-proxy container, check if the container has access to certificates:

ls -l /etc/nginx/certs

Some of my local certificates could not be displayed because of access permissions. By adding read access for the group (g+r) with sudo, it solved the problem for me.

sudo chmod g+r foo.bar.crt
sudo chmod g+r foo.bar.key

Hope this helps someone else.

@jantoine1
Copy link

I had a similar issue when trying to use the VIRTUAL_HOST_MULTIPORTS config. It seems there is an issue when trying to parse the YAML from the docs. When I switched to JSON, everything started working as expected.

@teodoryantcheff
Copy link

teodoryantcheff commented Aug 27, 2024

I tested some images and I found all the new images build after this 1.2-alpine didn't works. And all the image with the oldest tag works as expected

Can confirm! Just hit the same issue in prod. Certs generated by cerbot, been working for at least 18 months.
After an nginx-proxy restart (running an image with not specified version previously 🤦), we ended up with latest and the errors started appearing in the logs.

To "resolve" -- tested with 1.6, 1.6-alpine, 1.5, 1.5-alpine, 1.4, 1.4-alpine, 1.3, 1.3-alpine. The version that DOES NOT prevent nginx-proxy from starting turned out to be 1.2 (1.2-alpine also works, btw)


teo@docker-host-02:~/nginx-proxy$ ll
total 28
drwxrwxr-x  3 teo teo 4096 Aug 27 07:44 ./
drwxr-x--- 11 teo teo 4096 Aug 27 06:42 ../
drwxrwxr-x  2 teo teo 4096 Aug 27 06:51 cert_backup/
-rw-rw-r--  1 teo teo  369 Feb 19  2024 config_additional.conf
-rwxrwxr-x  1 teo teo 1145 Aug 27 07:44 nginx-proxy.sh*
-rw-r--r--  1 teo teo 3590 Aug 27 07:33 hui_site.com.crt
-rw-r-----  1 teo teo 1704 Aug 27 07:33 hui_site.com.key

teo@docker-host-02:~/nginx-proxy$ cat nginx-proxy.sh
#!/usr/bin/env bash

set -x
docker network create nginx-proxy

docker run -d                                                                                   \
    -p 80:80 -p 443:443                                                                         \
    -v /home/teo/nginx-proxy/config_additional.conf:/etc/nginx/conf.d/config_additional.conf:ro \
    -v /home/teo/nginx-proxy/hui_site.com.crt:/etc/nginx/certs/hui_site.com.crt                 \
    -v /home/teo/nginx-proxy/hui_site.com.key:/etc/nginx/certs/hui_site.com.key                 \
    -v /var/run/docker.sock:/tmp/docker.sock:ro                                                 \
    -e ENABLE_IPV6=true                                                                         \
    --net nginx-proxy                                                                           \
    --name nginx-proxy                                                                          \
    --restart unless-stopped                                                                    \
    nginxproxy/nginx-proxy:1.2-alpine


teo@docker-host-02:~/nginx-proxy$ cat config_additional.conf
client_max_body_size 25m;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       # To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.crt
-----BEGIN CERTIFICATE-----
MIIE/DCCA+SgAwIBAgISA23GZ7JH4Cr6olQQ7BE0uieOMA0GCSqGSIb3DQEBCwUA
 ...<REDACTED>...
59tTd2tPREzzcgiCAa4ZCsD04NQP9hRlFiGormrsVUY=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFBTCCAu2gAwIBAgIQS6hSk/eaL6JzBkuoBI110DANBgkqhkiG9w0BAQsFADBP
 ...<REDACTED>...
KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=
-----END CERTIFICATE-----

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.key
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzww76Es93LWBS
b/n4BxgSioUW5LCFSExJtIrIum2aU66aS4bQUb2boFEnQKrjy+cvPoumh/mV9PBa
 ...<REDACTED>...
FOkxtBWESOydf4Nkt8IpeODLpbZ7AJS5R1CBs4Vt3Tzm/w1oyqd4TTDqByUfpA0Z
Nz9DXJ+ffhDlxui0gmRlTgY=
-----END PRIVATE KEY-----
teo@docker-host-02:~/nginx-proxy$

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy ls -lh /etc/nginx/certs
total 8K
-rw-r--r--    1 1000     1000        3.5K Aug 27 07:33 hui_site.com.crt
-rw-r-----    1 1000     1000        1.7K Aug 27 07:33 hui_site.com.key

And anything newer than 1.2 yields

nginx.1     | 2024/08/27 07:14:26 [error] 30#30: *1 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 172.70.175.40, server: 0.0.0.0:443
nginx.1     | 2024/08/27 07:14:28 [error] 31#31: *2 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 162.158.159.134, server: 0.0.0.0:443
nginx.1     | 2024/08/27 07:14:28 [error] 30#30: *3 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 162.158.159.110, server: 0.0.0.0:443
nginx.1     | 2024/08/27 07:14:35 [error] 30#30: *4 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 162.158.154.175, server: 0.0.0.0:443

Certificates created with certbot and renewed with

root@docker-host-01:/etc/cron.d# cat certbot
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin

0 3 * * * root /usr/bin/certbot --dns-cloudflare --dns-cloudflare-credentials=/root/.cloudflare_dnstoken renew --post-hook "docker restart nginx-proxy"
root@docker-host-01:/etc/cron.d#

openssl versions as follows:

root@docker-host-02:~# docker run -it --rm -v /var/run/docker.sock:/tmp/docker.sock:ro     -v  /home/teo/nginx-proxy/hui_site.crt:/etc/nginx/certs/hui_site.crt     -v  /home/teo/nginx-proxy/hui_site.key:/etc/nginx/certs/hui_site.key --name deleteme  nginxproxy/nginx-proxy:1.2-alpine openssl version
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)
root@docker-host-02:~# docker run -it --rm -v /var/run/docker.sock:/tmp/docker.sock:ro     -v  /home/teo/nginx-proxy/hui_site.crt:/etc/nginx/certs/hui_site.crt     -v  /home/teo/nginx-proxy/hui_site.key:/etc/nginx/certs/hui_site.key --name deleteme  nginxproxy/nginx-proxy:1.3-alpine openssl version
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)
root@docker-host-02:~# docker run -it --rm -v /var/run/docker.sock:/tmp/docker.sock:ro     -v  /home/teo/nginx-proxy/hui_site.crt:/etc/nginx/certs/hui_site.crt     -v  /home/teo/nginx-proxy/hui_site.key:/etc/nginx/certs/hui_site.key --name deleteme  nginxproxy/nginx-proxy:1.4-alpine openssl version
OpenSSL 3.1.4 24 Oct 2023 (Library: OpenSSL 3.1.4 24 Oct 2023)
root@docker-host-02:~# docker run -it --rm -v /var/run/docker.sock:/tmp/docker.sock:ro     -v  /home/teo/nginx-proxy/hui_site.crt:/etc/nginx/certs/hui_site.crt     -v  /home/teo/nginx-proxy/hui_site.key:/etc/nginx/certs/hui_site.key --name deleteme  nginxproxy/nginx-proxy:1.5-alpine openssl version
OpenSSL 3.1.4 24 Oct 2023 (Library: OpenSSL 3.1.4 24 Oct 2023)
root@docker-host-02:~# docker run -it --rm -v /var/run/docker.sock:/tmp/docker.sock:ro     -v  /home/teo/nginx-proxy/hui_site.crt:/etc/nginx/certs/hui_site.crt     -v  /home/teo/nginx-proxy/hui_site.key:/etc/nginx/certs/hui_site.key --name deleteme  nginxproxy/nginx-proxy:1.6-alpine openssl version
OpenSSL 3.1.5 30 Jan 2024 (Library: OpenSSL 3.1.5 30 Jan 2024)
root@docker-host-02~#

And all the versions are reading the certificate just fine:

docker run -it --rm -v /var/run/docker.sock:/tmp/docker.sock:ro              \
      -v  /home/teo/nginx-proxy/hui_site.crt:/etc/nginx/certs/hui_site.crt   \
      -v  /home/teo/nginx-proxy/hui_site.key:/etc/nginx/certs/hui_site.key   \
      --name deleteme                                                        \
 nginxproxy/nginx-proxy:[1.2-alpine, 1.3-alpine, 1.4-alpine, 1.5-alpine, 1.6-alpine] openssl x509 -noout -text -in /etc/nginx/certs/hui_site.crt

Or at least do not seem to be disliking anything about it.

@buchdag
Copy link
Member

buchdag commented Aug 27, 2024

To "resolve" -- tested with 1.6, 1.6-alpine, 1.5, 1.5-alpine, 1.4, 1.4-alpine, 1.3, 1.3-alpine. The version that DOES NOT prevent nginx-proxy from starting turned out to be 1.2 (1.2-alpine also works, btw)

@teodoryantcheff would you be able to test more specifically with 1.2.6, 1.3.0 and 1.3.1 (see #2287 (comment)) and post the working and non working rendered configs (docker exec yournginxcontainer nginx -T) ?

@teodoryantcheff
Copy link

teodoryantcheff commented Aug 27, 2024

@buchdag , This is from a working nginx-proxy container running nginxproxy/nginx-proxy:1.2-alpine .

note: hui_site.com is not the real domain, I have redacted that out since it's a production system.

I'll be able to test the versions you asked for tomorrow and will send you the results.
Many thanks!

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/config_additional.conf:
client_max_body_size 25m;

# To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.2.3
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# 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;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $http_host;
}
# 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, preserve
# NGINX's default behavior ("Connection: close").
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;
# 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-Host $proxy_x_forwarded_host;
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;
proxy_set_header X-Original-URI $request_uri;
# 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;
    listen [::]:80;
    access_log /var/log/nginx/access.log vhost;
    return 503;
}
# checkout.hui_site.com/
upstream checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.7
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.7:8080;
}
server {
    server_name checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://checkout.hui_site.com;
    }
}
# freight-manager.hui_site.com/
upstream freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.8
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.8:8080;
}
server {
    server_name freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://freight-manager.hui_site.com;
    }
}
# infisical.hui_site.com/
upstream infisical.hui_site.com {
    # Container: infisical
    #     networks:
    #         nginx-proxy (reachable)
    #         postgres (unreachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 443/tcp 8080/tcp
    #     default port: 80
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name infisical.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 infisical.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://infisical.hui_site.com;
    }
}
# production-2ec02e-freight-manager.hui_site.com/
upstream production-2ec02e-freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.8
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.8:8080;
}
server {
    server_name production-2ec02e-freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-2ec02e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-2ec02e-freight-manager.hui_site.com;
    }
}
# production-c5037e-sgt-checkout.hui_site.com/
upstream production-c5037e-sgt-checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.7
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.7:8080;
}
server {
    server_name production-c5037e-sgt-checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-c5037e-sgt-checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-c5037e-sgt-checkout.hui_site.com;
    }
}
# staging-2f8170-freight-manager.hui_site.com/
upstream staging-2f8170-freight-manager.hui_site.com {
    # Container: fm-container-staging-2f8170
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.6
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.6:8080;
}
server {
    server_name staging-2f8170-freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 staging-2f8170-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://staging-2f8170-freight-manager.hui_site.com;
    }
}
# staging-bb3d8e-freight-manager.hui_site.com/
upstream staging-bb3d8e-freight-manager.hui_site.com {
    # Container: fm-container-staging-bb3d8e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.5
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.5:8080;
}
server {
    server_name staging-bb3d8e-freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 staging-bb3d8e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://staging-bb3d8e-freight-manager.hui_site.com;
    }
}
# ws.hui_site.com/
upstream ws.hui_site.com {
    # Container: websocket
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.2
    #     exposed ports: 6001/tcp
    #     default port: 6001
    #     using port: 6001
    server 172.18.0.2:6001;
}
server {
    server_name ws.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 ws.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://ws.hui_site.com;
    }
}

@buchdag
Copy link
Member

buchdag commented Aug 27, 2024

edit: I'm not sure at all that's relevant

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy ls -lh /etc/nginx/certs
total 8K
-rw-r--r-- 1 1000 1000 3.5K Aug 27 07:33 hui_site.com.crt
-rw-r----- 1 1000 1000 1.7K Aug 27 07:33 hui_site.com.key

The nginx worker processes run as the nginx user, with UID and GID 101, not 1000.

When you exec into the container, you do it as the root user by default. I replicated two file with those permissions and I sure can't read the private key file when using the nginx user:

$ docker exec --user nginx nginx-test ls -Alh /etc/nginx/certs
total 8.0K
-rw-r--r-- 1 1000 1000 4 Aug 27 18:06 foobar.crt
-rw-r----- 1 1000 1000 4 Aug 27 18:07 foobar.key
$ docker exec --user nginx nginx-test cat /etc/nginx/certs/foobar.crt
some content
$ docker exec --user nginx nginx-test cat /etc/nginx/certs/foobar.key
cat: /etc/nginx/certs/foobar.key: Permission denied

@teodoryantcheff
Copy link

teodoryantcheff commented Aug 27, 2024

@buchdag, not really:

on the host:

teo@docker-host-02:~/nginx-proxy$ ll
total 24
drwxrwxr-x  2 teo teo 4096 Aug 27 14:44 ./
drwxr-x--- 11 teo teo 4096 Aug 27 14:45 ../
-rw-rw-r--  1 teo teo  369 Feb 19  2024 config_additional.conf
-rwxrwxr-x  1 teo teo 1214 Aug 27 14:44 nginx-proxy.sh*
-rw-r--r--  1 teo teo 3590 Aug 27 07:33 hui_site.com.crt
-rw-------  1 teo teo 1704 Aug 27 07:33 hui_site.com.key

in the container:

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy ls -l /etc/nginx/certs
total 8
-rw-r--r--    1 1000     1000          3590 Aug 27 07:33 hui_site.com.crt
-rw-------    1 1000     1000          1704 Aug 27 07:33 hui_site.com.key

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.key
-----BEGIN PRIVATE KEY-----
MI....
<REDACTED>
....Y=
-----END PRIVATE KEY-----
teo@docker-host-02:~/nginx-proxy$

teo@docker-host-02:~/nginx-proxy$ docker exec nginx-proxy id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

root IN the container has an id of 0 and has no issues reading that .key file.

Not only that, but on that host I was able to run nginxproxy/nginx-proxy:1.6-alpine without any issues whatsoever.

I have a reproducible example from a host having those files owned by root on the host and openssl load certificate errors out with Expecting: TRUSTED CERTIFICATE. There only 1.2 is working. And there the certs are owned by root.

The output of which I will be able to provide tomorrow, alongside the specific version tests you requested.

@jacekv
Copy link

jacekv commented Aug 29, 2024

It seems that the /etc/nginx/conf.d/default.conf is not generated properly.

I started the nginx-proxy and had the same issue. I had a look into the default.conf and had the following lines in the server block for my virtual host:

set $empty "";
ssl_certificate data:$empty;
ssl_certificate_key data:$empty;

Once I removed the set command and adjusted the ssl_certificate and ssl_certificate_key to the corresponding paths, it was working.

I am currently trying to reproduce that, but it sets the config all the time correctly now.

But here an example for default:

# No default.crt certificate found for this vhost, so force nginx to emit a
# TLS error if the client connects via https.
ssl_ciphers aNULL;
set $empty "";
ssl_certificate data:$empty;
ssl_certificate_key data:$empty;

@teodoryantcheff
Copy link

teodoryantcheff commented Aug 30, 2024

I am currently trying to reproduce that, but it sets the config all the time correctly now.

Exactly -- when I sat down to provide examples of the issue, I could no longer reproduce it So now all those reported below actually work. Why -- I have no idea, but it was not when I wrote those messages above... 🤦‍♂️

Common setup

root@docker-host-03:~/nginx-proxy# ll
total 24
drwxr-xr-x  2 root root 4096 Aug 28 05:54 ./
drwx------ 15 root root 4096 Aug 28 06:01 ../
-rw-r--r--  1 root root  369 Jul 24 10:24 config_additional.conf
-rwxr-xr-x  1 root root 1283 Aug 28 05:54 nginx-proxy.sh*
-rw-r--r--  1 root root 3590 Aug  9 03:05 hui_site.com.crt
-rw-------  1 root root 1704 Aug  9 03:05 hui_site.com.key

root@docker-host-03:~/nginx-proxy# cat config_additional.conf
client_max_body_size 25m;

# To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

root@docker-host-03:~/nginx-proxy# cat nginx-proxy.sh
#!/usr/bin/env bash

set -x

docker network create nginx-proxy
docker run -d                                                                                   \
    -p 80:80 -p 443:443                                                                         \
    -v /root/nginx-proxy/config_additional.conf:/etc/nginx/conf.d/config_additional.conf:ro     \
    -v /root/nginx-proxy/hui_site.com.crt:/etc/nginx/certs/hui_site.com.crt:ro  \
    -v /root/nginx-proxy/hui_site.com.key:/etc/nginx/certs/hui_site.com.key:ro  \
    -v /var/run/docker.sock:/tmp/docker.sock:ro                                                 \
    -e ENABLE_IPV6=true                                                                         \
    --net nginx-proxy                                                                           \
    --name nginx-proxy                                                                          \
    --restart unless-stopped                                                                    \
    nginxproxy/nginx-proxy:[xxxxx]
root@docker-host-03:~/nginx-proxy#

nginxproxy/nginx-proxy:1.2-alpine

since there is no 1.2.6 tag in docker hub, this is the image the container ended up running:

"Env": [
    "ENABLE_IPV6=true",
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "NGINX_VERSION=1.23.3",
    "PKG_RELEASE=1",
    "NJS_VERSION=0.7.9",
    "NGINX_PROXY_VERSION=1.2.3",
    "DOCKER_GEN_VERSION=0.10.2",
    "DOCKER_HOST=unix:///tmp/docker.sock"
],
"Cmd": [
    "forego",
    "start",
    "-r"
],
"Image": "nginxproxy/nginx-proxy:1.2-alpine",
"Volumes": null,
"WorkingDir": "/app/",
"Entrypoint": [
    "/app/docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {
    "maintainer": "NGINX Docker Maintainers <[email protected]>",
    "org.opencontainers.image.authors": "Nicolas Duchon <[email protected]> (@buchdag), Jason Wilder",
    "org.opencontainers.image.created": "2023-03-21T06:29:26.992Z",
    "org.opencontainers.image.description": "Automated nginx proxy for Docker containers using docker-gen",
    "org.opencontainers.image.licenses": "MIT",
    "org.opencontainers.image.revision": "6c2d17586b21dac1de33bf05230425ac1d12d2f5",
    "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": "1.2.3"
},

certs:

root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy ls -l /etc/nginx/certs
total 8
-rw-r--r--    1 root     root          3590 Aug  9 03:05 hui_site.com.crt
-rw-------    1 root     root          1704 Aug  9 03:05 hui_site.com.key
root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.key
-----BEGIN PRIVATE KEY-----
is readable

And the resulting config (root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy nginx -T):

1.2 generated conf
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/config_additional.conf:
client_max_body_size 25m;

# To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.2.3
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# 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;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $http_host;
}
# 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, preserve
# NGINX's default behavior ("Connection: close").
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;
# 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-Host $proxy_x_forwarded_host;
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;
proxy_set_header X-Original-URI $request_uri;
# 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;
    listen [::]:80;
    access_log /var/log/nginx/access.log vhost;
    return 503;
}
# checkout.hui_site.com/
upstream checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://checkout.hui_site.com;
    }
}
# freight-manager.hui_site.com/
upstream freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://freight-manager.hui_site.com;
    }
}
# infisical.hui_site.com/
upstream infisical.hui_site.com {
    # Container: infisical
    #     networks:
    #         nginx-proxy (reachable)
    #         postgres (unreachable)
    #     IP address: 172.18.0.6
    #     exposed ports: 443/tcp 8080/tcp
    #     default port: 80
    #     using port: 8080
    server 172.18.0.6:8080;
}
server {
    server_name infisical.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 infisical.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://infisical.hui_site.com;
    }
}
# production-2ec02e-freight-manager.hui_site.com/
upstream production-2ec02e-freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name production-2ec02e-freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-2ec02e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-2ec02e-freight-manager.hui_site.com;
    }
}
# production-c5037e-sgt-checkout.hui_site.com/
upstream production-c5037e-sgt-checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name production-c5037e-sgt-checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-c5037e-sgt-checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-c5037e-sgt-checkout.hui_site.com;
    }
}
# ws.hui_site.com/
upstream ws.hui_site.com {
    # Container: websocket
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.8
    #     exposed ports: 6001/tcp
    #     default port: 6001
    #     using port: 6001
    server 172.18.0.8:6001;
}
server {
    server_name ws.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 ws.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://ws.hui_site.com;
    }
}

nginxproxy/nginx-proxy:1.3.0-alpine

certs:

root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy ls -l /etc/nginx/certs
total 8
-rw-r--r--    1 root     root          3590 Aug  9 03:05 hui_site.com.crt
-rw-------    1 root     root          1704 Aug  9 03:05 hui_site.com.key
root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.key
-----BEGIN PRIVATE KEY-----
is readable
1.3.0 generated conf
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/config_additional.conf:
client_max_body_size 25m;

# To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.3.0
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# 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;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $http_host;
}
# 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 the request from the downstream client has an "Upgrade:" header (set to any
# non-empty value), pass "Connection: upgrade" to the upstream (backend) server.
# Otherwise, the value for the "Connection" header depends on whether the user
# has enabled keepalive to the upstream server.
map $http_upgrade $proxy_connection {
    default upgrade;
    '' $proxy_connection_noupgrade;
}
map $upstream_keepalive $proxy_connection_noupgrade {
    # Preserve nginx's default behavior (send "Connection: close").
    default close;
    # Use an empty string to cancel nginx's default behavior.
    true '';
}
# Abuse the map directive (see <https://stackoverflow.com/q/14433309>) to ensure
# that $upstream_keepalive is always defined.  This is necessary because:
#   - The $proxy_connection variable is indirectly derived from
#     $upstream_keepalive, so $upstream_keepalive must be defined whenever
#     $proxy_connection is resolved.
#   - The $proxy_connection variable is used in a proxy_set_header directive in
#     the http block, so it is always fully resolved for every request -- even
#     those where proxy_pass is not used (e.g., unknown virtual host).
map "" $upstream_keepalive {
    # The value here should not matter because it should always be overridden in
    # a location block (see the "location" template) for all requests where the
    # value actually matters.
    default false;
}
# 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;
# 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-Host $proxy_x_forwarded_host;
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;
proxy_set_header X-Original-URI $request_uri;
# 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;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    access_log /var/log/nginx/access.log vhost;
    # No default.crt certificate found for this vhost, so force nginx to emit a
    # TLS error if the client connects via https.
    ssl_ciphers aNULL;
    set $empty "";
    ssl_certificate data:$empty;
    ssl_certificate_key data:$empty;
    if ($https) {
        return 444;
    }
    return 503;
}
# checkout.hui_site.com/
upstream checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://checkout.hui_site.com;
        set $upstream_keepalive false;
    }
}
# freight-manager.hui_site.com/
upstream freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://freight-manager.hui_site.com;
        set $upstream_keepalive false;
    }
}
# infisical.hui_site.com/
upstream infisical.hui_site.com {
    # Container: infisical
    #     networks:
    #         nginx-proxy (reachable)
    #         postgres (unreachable)
    #     IP address: 172.18.0.6
    #     exposed ports: 443/tcp 8080/tcp
    #     default port: 80
    #     using port: 8080
    server 172.18.0.6:8080;
}
server {
    server_name infisical.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 infisical.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://infisical.hui_site.com;
        set $upstream_keepalive false;
    }
}
# production-2ec02e-freight-manager.hui_site.com/
upstream production-2ec02e-freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name production-2ec02e-freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-2ec02e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-2ec02e-freight-manager.hui_site.com;
        set $upstream_keepalive false;
    }
}
# production-c5037e-sgt-checkout.hui_site.com/
upstream production-c5037e-sgt-checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name production-c5037e-sgt-checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-c5037e-sgt-checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-c5037e-sgt-checkout.hui_site.com;
        set $upstream_keepalive false;
    }
}
# ws.hui_site.com/
upstream ws.hui_site.com {
    # Container: websocket
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.8
    #     exposed ports: 6001/tcp
    #     default port: 6001
    #     using port: 6001
    server 172.18.0.8:6001;
}
server {
    server_name ws.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 ws.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://ws.hui_site.com;
        set $upstream_keepalive false;
    }
}

nginxproxy/nginx-proxy:1.3.1-alpine

root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.key
-----BEGIN PRIVATE KEY-----
... is readable
1.3.1 generated conf
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/config_additional.conf:
client_max_body_size 25m;

# To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.3.1
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# 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;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $http_host;
}
# 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 the request from the downstream client has an "Upgrade:" header (set to any
# non-empty value), pass "Connection: upgrade" to the upstream (backend) server.
# Otherwise, the value for the "Connection" header depends on whether the user
# has enabled keepalive to the upstream server.
map $http_upgrade $proxy_connection {
    default upgrade;
    '' $proxy_connection_noupgrade;
}
map $upstream_keepalive $proxy_connection_noupgrade {
    # Preserve nginx's default behavior (send "Connection: close").
    default close;
    # Use an empty string to cancel nginx's default behavior.
    true '';
}
# Abuse the map directive (see <https://stackoverflow.com/q/14433309>) to ensure
# that $upstream_keepalive is always defined.  This is necessary because:
#   - The $proxy_connection variable is indirectly derived from
#     $upstream_keepalive, so $upstream_keepalive must be defined whenever
#     $proxy_connection is resolved.
#   - The $proxy_connection variable is used in a proxy_set_header directive in
#     the http block, so it is always fully resolved for every request -- even
#     those where proxy_pass is not used (e.g., unknown virtual host).
map "" $upstream_keepalive {
    # The value here should not matter because it should always be overridden in
    # a location block (see the "location" template) for all requests where the
    # value actually matters.
    default false;
}
# 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;
# 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-Host $proxy_x_forwarded_host;
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;
proxy_set_header X-Original-URI $request_uri;
# 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;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    access_log /var/log/nginx/access.log vhost;
    # No default.crt certificate found for this vhost, so force nginx to emit a
    # TLS error if the client connects via https.
    ssl_ciphers aNULL;
    set $empty "";
    ssl_certificate data:$empty;
    ssl_certificate_key data:$empty;
    if ($https) {
        return 444;
    }
    return 503;
}
# checkout.hui_site.com/
upstream checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://checkout.hui_site.com;
        set $upstream_keepalive false;
    }
}
# freight-manager.hui_site.com/
upstream freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://freight-manager.hui_site.com;
        set $upstream_keepalive false;
    }
}
# infisical.hui_site.com/
upstream infisical.hui_site.com {
    # Container: infisical
    #     networks:
    #         nginx-proxy (reachable)
    #         postgres (unreachable)
    #     IP address: 172.18.0.6
    #     exposed ports: 443/tcp 8080/tcp
    #     default port: 80
    #     using port: 8080
    server 172.18.0.6:8080;
}
server {
    server_name infisical.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 infisical.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://infisical.hui_site.com;
        set $upstream_keepalive false;
    }
}
# production-2ec02e-freight-manager.hui_site.com/
upstream production-2ec02e-freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name production-2ec02e-freight-manager.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-2ec02e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-2ec02e-freight-manager.hui_site.com;
        set $upstream_keepalive false;
    }
}
# production-c5037e-sgt-checkout.hui_site.com/
upstream production-c5037e-sgt-checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name production-c5037e-sgt-checkout.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 production-c5037e-sgt-checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-c5037e-sgt-checkout.hui_site.com;
        set $upstream_keepalive false;
    }
}
# ws.hui_site.com/
upstream ws.hui_site.com {
    # Container: websocket
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.8
    #     exposed ports: 6001/tcp
    #     default port: 6001
    #     using port: 6001
    server 172.18.0.8:6001;
}
server {
    server_name ws.hui_site.com;
    listen 80 ;
    listen [::]:80 ;
    access_log /var/log/nginx/access.log vhost;
    # Do not HTTPS redirect Let's Encrypt 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 ws.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 443 ssl http2 ;
    listen [::]:443 ssl http2 ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://ws.hui_site.com;
        set $upstream_keepalive false;
    }
}

nginxproxy/nginx-proxy:1.6-alpine

root@docker-host-03:~/nginx-proxy# docker exec nginx-proxy cat /etc/nginx/certs/hui_site.com.key
-----BEGIN PRIVATE KEY-----
... is readable
1.6 generated conf
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;
}
worker_rlimit_nofile 20480;


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;
}

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

# 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/config_additional.conf:
client_max_body_size 25m;

# To prevent error "upstream sent too big header while reading response header from upstream"
# https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
proxy_buffer_size              16k;
proxy_buffers                8 16k;
proxy_busy_buffers_size        16k;
# For large cookies
large_client_header_buffers  4 16k;

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.6.0
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# 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;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $host;
}
# 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;
}
# Include the port in the Host header sent to the container if it is non-standard
map $server_port $host_port {
    default :$server_port;
    80 '';
    443 '';
}
# If the request from the downstream client has an "Upgrade:" header (set to any
# non-empty value), pass "Connection: upgrade" to the upstream (backend) server.
# Otherwise, the value for the "Connection" header depends on whether the user
# has enabled keepalive to the upstream server.
map $http_upgrade $proxy_connection {
    default upgrade;
    '' $proxy_connection_noupgrade;
}
map $upstream_keepalive $proxy_connection_noupgrade {
    # Preserve nginx's default behavior (send "Connection: close").
    default close;
    # Use an empty string to cancel nginx's default behavior.
    true '';
}
# Abuse the map directive (see <https://stackoverflow.com/q/14433309>) to ensure
# that $upstream_keepalive is always defined.  This is necessary because:
#   - The $proxy_connection variable is indirectly derived from
#     $upstream_keepalive, so $upstream_keepalive must be defined whenever
#     $proxy_connection is resolved.
#   - The $proxy_connection variable is used in a proxy_set_header directive in
#     the http block, so it is always fully resolved for every request -- even
#     those where proxy_pass is not used (e.g., unknown virtual host).
map "" $upstream_keepalive {
    # The value here should not matter because it should always be overridden in
    # a location block (see the "location" template) for all requests where the
    # value actually matters.
    default false;
}
# 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 escape=default '$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:DHE-RSA-CHACHA20-POLY1305';
    ssl_prefer_server_ciphers off;
error_log /dev/stderr;
resolver 127.0.0.11;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_set_header Host $host$host_port;
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-Host $proxy_x_forwarded_host;
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;
proxy_set_header X-Original-URI $request_uri;
# 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;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 80;
    listen [::]:80;
    listen 443 ssl;
    listen [::]:443 ssl;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    # No default.crt certificate found for this vhost, so force nginx to emit a
    # TLS error if the client connects via https.
    ssl_ciphers aNULL;
    set $empty "";
    ssl_certificate data:$empty;
    ssl_certificate_key data:$empty;
    if ($https) {
        return 444;
    }
    location ^~ / {
        return 503;
    }
}
# checkout.hui_site.com/
upstream checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://checkout.hui_site.com;
        set $upstream_keepalive false;
    }
}
# freight-manager.hui_site.com/
upstream freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://freight-manager.hui_site.com;
        set $upstream_keepalive false;
    }
}
# infisical.hui_site.com/
upstream infisical.hui_site.com {
    # Container: infisical
    #     networks:
    #         nginx-proxy (reachable)
    #         postgres (unreachable)
    #     IP address: 172.18.0.6
    #     exposed ports: 443/tcp 8080/tcp
    #     default port: 80
    #     using port: 8080
    server 172.18.0.6:8080;
}
server {
    server_name infisical.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 infisical.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://infisical.hui_site.com;
        set $upstream_keepalive false;
    }
}
# production-2ec02e-freight-manager.hui_site.com/
upstream production-2ec02e-freight-manager.hui_site.com {
    # Container: fm-container-production-2ec02e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.4
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.4:8080;
}
server {
    server_name production-2ec02e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 production-2ec02e-freight-manager.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-2ec02e-freight-manager.hui_site.com;
        set $upstream_keepalive false;
    }
}
# production-c5037e-sgt-checkout.hui_site.com/
upstream production-c5037e-sgt-checkout.hui_site.com {
    # Container: sgt-checkout-container-production-c5037e
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: 8080/tcp
    #     default port: 8080
    #     using port: 8080
    server 172.18.0.3:8080;
}
server {
    server_name production-c5037e-sgt-checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 production-c5037e-sgt-checkout.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://production-c5037e-sgt-checkout.hui_site.com;
        set $upstream_keepalive false;
    }
}
# ws.hui_site.com/
upstream ws.hui_site.com {
    # Container: websocket
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.8
    #     exposed ports: 6001/tcp
    #     default port: 6001
    #     using port: 6001
    server 172.18.0.8:6001;
}
server {
    server_name ws.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 ws.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://ws.hui_site.com;
        set $upstream_keepalive false;
    }
}

@teodoryantcheff
Copy link

I could have added the produced nginx configs as file attachments.

@buchdag
Copy link
Member

buchdag commented Sep 4, 2024

@teodoryantcheff I took the liberty to add collapsible sections to your previous message.

Did anything else change on your setup between the non working and the now working use of 1.6 ? Did you add a default certificate and key ?

The lines quoted by @jacekv seem to be likely culprit but I really need to see them in the context of a fully generated config that can reliably reproduce the issue.

To anyone experiencing this bug : please ONLY post full nginx configs obtained with docker exec nginx-proxy nginx -T (in addition to the nginx-proxy and proxied container config, etc), I doubt that config snippets will be of any help at this point.

@teodoryantcheff
Copy link

@buchdag

@teodoryantcheff I took the liberty to add collapsible sections to your previous message.

Thank you! I should have been smarter about that.

Did anything else change on your setup between the non working and the now working use of 1.6 ? Did you add a default certificate and key ?

Unfortunately, did not change anything. Just as described above. Same system, same certificates, same host, same everything. It was not working at one time and then magically started producing working nginx configs.

Sorry for the lack of depth in that description....

@VasilNikolov
Copy link

VasilNikolov commented Sep 13, 2024

Chiming in with some more data on the issue. We're facing the same errors, but our service is running without an issue behind the proxy...which is... strange?

certs
bpz@bpz-api-fra1:~/nginx-proxy$ docker exec nginx-proxy-1.6-alpine ls -l /etc/nginx/certs
total 8
-rw-r--r--    1 root     root          2851 Aug 12 19:15 hui_site.crt
-rw-------    1 root     root           241 Aug 12 19:15 hui_site.key
generated conf
bpz@bpz-api-fra1:~/nginx-proxy$ docker exec nginx-proxy-1.6-alpine nginx -T
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;
}
worker_rlimit_nofile 20480;


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;
}

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

# 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/config_additional.conf:
client_max_body_size 1000m;
send_timeout 5m;
client_body_timeout 5m;
client_header_timeout 5m;

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy version : 1.6.0
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# 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;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $host;
}
# 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;
}
# Include the port in the Host header sent to the container if it is non-standard
map $server_port $host_port {
    default :$server_port;
    80 '';
    443 '';
}
# If the request from the downstream client has an "Upgrade:" header (set to any
# non-empty value), pass "Connection: upgrade" to the upstream (backend) server.
# Otherwise, the value for the "Connection" header depends on whether the user
# has enabled keepalive to the upstream server.
map $http_upgrade $proxy_connection {
    default upgrade;
    '' $proxy_connection_noupgrade;
}
map $upstream_keepalive $proxy_connection_noupgrade {
    # Preserve nginx's default behavior (send "Connection: close").
    default close;
    # Use an empty string to cancel nginx's default behavior.
    true '';
}
# Abuse the map directive (see <https://stackoverflow.com/q/14433309>) to ensure
# that $upstream_keepalive is always defined.  This is necessary because:
#   - The $proxy_connection variable is indirectly derived from
#     $upstream_keepalive, so $upstream_keepalive must be defined whenever
#     $proxy_connection is resolved.
#   - The $proxy_connection variable is used in a proxy_set_header directive in
#     the http block, so it is always fully resolved for every request -- even
#     those where proxy_pass is not used (e.g., unknown virtual host).
map "" $upstream_keepalive {
    # The value here should not matter because it should always be overridden in
    # a location block (see the "location" template) for all requests where the
    # value actually matters.
    default false;
}
# 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 escape=default '$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:DHE-RSA-CHACHA20-POLY1305';
    ssl_prefer_server_ciphers off;
error_log /dev/stderr;
resolver 127.0.0.11;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_set_header Host $host$host_port;
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-Host $proxy_x_forwarded_host;
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;
proxy_set_header X-Original-URI $request_uri;
# 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;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 80;
    listen [::]:80;
    listen 443 ssl;
    listen [::]:443 ssl;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    # No default.crt certificate found for this vhost, so force nginx to emit a
    # TLS error if the client connects via https.
    ssl_ciphers aNULL;
    set $empty "";
    ssl_certificate data:$empty;
    ssl_certificate_key data:$empty;
    if ($https) {
        return 444;
    }
    location ^~ / {
        return 503;
    }
}
# api.hui_site.com/
upstream api.hui_site.com {
    # Container: bpz-api-prod-backend-1
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: 172.18.0.3
    #     exposed ports: (none)
    #     default port: 80
    #     using port: 8082
    server 172.18.0.3:8082;
}
server {
    server_name api.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen [::]:80 ;
    # Do not HTTPS redirect Let's Encrypt 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 api.hui_site.com;
    access_log /var/log/nginx/access.log vhost;
    http2 on;
    listen 443 ssl ;
    listen [::]:443 ssl ;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_certificate /etc/nginx/certs/api.hui_site.com.crt;
    ssl_certificate_key /etc/nginx/certs/api.hui_site.com.key;
    set $sts_header "";
    if ($https) {
        set $sts_header "max-age=31536000";
    }
    add_header Strict-Transport-Security $sts_header always;
    location / {
        proxy_pass http://api.hui_site.com;
        set $upstream_keepalive false;
    }
}

When checking the logs, i see subsequent requests from our uptime monitors, which, of course, make the same requests periodically, all of them are resolved successfully, but some of them have the error logged right after.

The logs
nginx.1     | api.hui_site.com 159.89.185.30 - - [13/Sep/2024:05:52:21 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | 2024/09/13 05:52:21 [error] 27#27: *11099 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 185.81.68.125, server: 0.0.0.0:443
nginx.1     | api.hui_site.com 188.166.6.106 - - [13/Sep/2024:05:52:24 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | api.hui_site.com 138.68.248.57 - - [13/Sep/2024:05:52:34 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | api.hui_site.com 134.209.103.241 - - [13/Sep/2024:05:52:47 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | api.hui_site.com 159.89.185.30 - - [13/Sep/2024:05:53:21 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | api.hui_site.com 188.166.6.106 - - [13/Sep/2024:05:53:24 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | api.hui_site.com 138.68.248.57 - - [13/Sep/2024:05:53:33 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"
nginx.1     | 2024/09/13 05:53:38 [error] 27#27: *11112 cannot load certificate "data:": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE) while SSL handshaking, client: 88.80.189.24, server: 0.0.0.0:443
nginx.1     | api.hui_site.com 134.209.103.241 - - [13/Sep/2024:05:53:47 +0000] "GET /admin/login HTTP/2.0" 200 5929 "-" "DigitalOcean Uptime Probe 0.22.0 (https://digitalocean.com)" "172.18.0.3:8082"

@buchdag
Copy link
Member

buchdag commented Oct 3, 2024

#2520 should have fixed this, please chime in if you still encounter the issue with latest

I'll do a new patch release by the end of the week.

@buchdag
Copy link
Member

buchdag commented Oct 6, 2024

Fix released in version 1.6.2.

LiohMoeller added a commit to LiohMoeller/pixelfed that referenced this issue Jan 5, 2025
Expecting: TRUSTED CERTIFICATE) while SSL handshaking
fixes: nginx-proxy/nginx-proxy#2287
@buchdag buchdag removed the kind/bug Issue reporting a bug label Jan 19, 2025
eufelipemateus added a commit to eufelipemateus/pixelfed that referenced this issue Mar 4, 2025
* resolve merge conflicts

* resolve merge conflicts

* resolve merge conflicts

* Update CollectionController, fix showCollection signature

* Update ApiV1Dot1Controller, fix in-app registration

* Update changelog

* Fix missing video thumbnails on hashtag page (pixelfed#5394).

* Update VerifyCsrfToken middleware, add oauth token. Fixes pixelfed#5426

* Fix oauth endpoint

* New translations web.php (Portuguese, Brazilian)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* New translations web.php (Serbian (Cyrillic))
[ci skip]

* New translations web.php (Chinese Simplified)
[ci skip]

* New translations web.php (Chinese Traditional)
[ci skip]

* New translations web.php (Serbian (Latin))
[ci skip]

* Update AdminSettingsController, increase max photo size limit from 50MB to 1GB

* Update changelog. Fixes pixelfed#5431

* New translations web.php (Portuguese, Brazilian)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* New translations web.php (Serbian (Cyrillic))
[ci skip]

* New translations web.php (Chinese Simplified)
[ci skip]

* New translations web.php (Chinese Traditional)
[ci skip]

* New translations web.php (Serbian (Latin))
[ci skip]

* Update BearerTokenResponse, return scopes in oauth/token endpoint. Fixes pixelfed#5286

* Update changelog

* Fix typo

* Update docker-compose.yml

Expecting: TRUSTED CERTIFICATE) while SSL handshaking
fixes: nginx-proxy/nginx-proxy#2287

* Refactor Hashtag component from pixelfed#5427

* Update compiled assets

* Update AP Status Transformer, fix inReplyTo. Fixes pixelfed#5409

* Update changelog

* Update .env.docker

Updated DOCKER_PROXY_VERSION in .env

* Update docker-compose.yml

use DOCKER_PROXY_VERSION env var instead

* Update Data Export, refactor following/follower and statuses exports to allow accounts of any size with api entity instead of ap

* Update changelog

* Update .env.docker

Registry has changed. Old registry has been discontinued in August 2024. New Registry added, format of Docker tag has been adjusted as it now contains the Debian Release as well.

Sample Version is set to current stable but can be adjusted to any of the available branches.

* Update .env.docker

Stick major.minor according to https://jippi.github.io/docker-pixelfed/customize/tags/#pixelfed-version

Disable Debian Release Check until it's solved in dottie.

Closes pixelfed#5264

* New translations web.php (Portuguese, Brazilian)
[ci skip]

* New translations web.php (German)
[ci skip]

* Add ReclaimUsername command

* Update oauth/token, fix scope to be space separated string instead of array

* New translations web.php (Spanish)
[ci skip]

* New translations web.php (German)
[ci skip]

* Fix notifications not being delivered by directly checking the state from the database

* Add a push notification when a user is mentioned in a comment

* New translations web.php (Spanish)
[ci skip]

* New translations web.php (German)
[ci skip]

* Fix text no posts archived

* Update SearchApiV2Service, fix hashtag search

* Increase username length limit from 15 to 30

* Update Discover, fix account bug

* Add story components

* Update AP Helpers, fix comment bug

* New translations web.php (Finnish)
[ci skip]

* Update PublicApiController

* New translations web.php (Finnish)
[ci skip]

* fix: don't restore memory limit after cities import

Since this command can only be invoked by CLI, the process will exit after a successful import, so restoring the transient PHP memory limit doesn't really have any affect.

In PHP 8.4, this throws the following error (which doesn't happen in 8.3 and below)

> [entrypoint / 11-first-time-setup.sh] - (stderr) 128769/128769 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%[2025-01-20 11:29:23] production.ERROR: Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) {"exception":"[object] (ErrorException(code: 0): Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) at /var/www/app/Console/Commands/ImportCities.php:140)

It seems to be a 8.4 behavior change, so removing the logic would make it go away

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* Update ComposeController, add max_media_attachments attribute

* Update changelog

* New translations web.php (Portuguese)
[ci skip]

* add kickstarter and monthly users badge (pixelfed#5589)

Co-authored-by: daniel <[email protected]>

* add kickstarter and monthly users badge (pixelfed#5589) (pixelfed#5591)

Co-authored-by: Simon Laux <[email protected]>

* DM

* Staging (pixelfed#5594)

* add kickstarter and monthly users badge (pixelfed#5589)

Co-authored-by: daniel <[email protected]>

* DM

---------

Co-authored-by: Simon Laux <[email protected]>

* Fix the local column for statuses to not include remote shares (pixelfed#5513)

* Fix the local column for statuses to not include remote shares

* Chunk the migration

* Refactor migration

* Staging (pixelfed#5603)

* add kickstarter and monthly users badge (pixelfed#5589)

Co-authored-by: daniel <[email protected]>

* DM

* Fix the local column for statuses to not include remote shares (pixelfed#5513)

* Fix the local column for statuses to not include remote shares

* Chunk the migration

* Refactor migration

---------

Co-authored-by: Simon Laux <[email protected]>
Co-authored-by: Anil Kulkarni <[email protected]>

* Fix GroupController, move groups enabled check to each method to fix route:list

* Update changelog

* Staging (pixelfed#5604)

* add kickstarter and monthly users badge (pixelfed#5589)

Co-authored-by: daniel <[email protected]>

* DM

* Fix the local column for statuses to not include remote shares (pixelfed#5513)

* Fix the local column for statuses to not include remote shares

* Chunk the migration

* Refactor migration

* Fix GroupController, move groups enabled check to each method to fix route:list

* Update changelog

---------

Co-authored-by: Simon Laux <[email protected]>
Co-authored-by: Anil Kulkarni <[email protected]>

* Update AdminSettingsController, persist updates to ConfigCacheService

* Fix pixelfed#5619

* Update FixUsernames.php

* fix(compose-modal): avoid WebGL if it's not needed

* fix(compose-modal): update webgl-media-editor

* New translations web.php (Hungarian)
[ci skip]

* Update MediaStorageService, handle local media deletes after successful S3 upload

* Update changelog

* Add AppRegister

* Add form

* Add rate limits, fix typo and styling

* Update AppServiceProvider.php

* Fix redirects

* Update routes

* Update AppRegisterController

* Update AppRegisterController.php

* Update AppRegisterController

* New translations web.php (Russian)
[ci skip]

* Improve onboarding response

* New translations web.php (Russian)
[ci skip]

* Updaet AppRegisterController, add client id/secret

* use config_cache for max_caption_length

* Update AppRegisterController.php

* Update AppRegisterController.php

* AdminStatsService: do not count deleted users

* Skip thumbnail cloud upload if no thumbnail exists

migrate2cloud fails on media without thumbnail.
fix check for existing thumbnail, skip upload if none exists.

* Refactor based on @jippi review

* Update nodeinfo

* Update ApiV1Controller, add mobile_registration attribute

* Update ApiV1Controller.php

* Update auth.php

* Update ApiV1Controller.php

* Update .env.example

Adding the parameter INSTANCE_DISCOVER_PUBLIC="true" to prevent a HTTP 403 error at the explorer tab in the instance preview.

* Update AccountTransformer.php

* New variable for lang spanish

* Variable for lang spanish

* Update Dockerfile, fixes pixelfed#5535 pixelfed#5559

* Fix pixelfed#5582

* Fix pixelfed#5632

* Update status twitter:card to summary_large_image for images/albums

* Update changelog

* Staging (pixelfed#5674)

* Update .env.docker

Registry has changed. Old registry has been discontinued in August 2024. New Registry added, format of Docker tag has been adjusted as it now contains the Debian Release as well.

Sample Version is set to current stable but can be adjusted to any of the available branches.

* Update .env.docker

Stick major.minor according to https://jippi.github.io/docker-pixelfed/customize/tags/#pixelfed-version

Disable Debian Release Check until it's solved in dottie.

Closes pixelfed#5264

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* fix: don't restore memory limit after cities import

Since this command can only be invoked by CLI, the process will exit after a successful import, so restoring the transient PHP memory limit doesn't really have any affect.

In PHP 8.4, this throws the following error (which doesn't happen in 8.3 and below)

> [entrypoint / 11-first-time-setup.sh] - (stderr) 128769/128769 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%[2025-01-20 11:29:23] production.ERROR: Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) {"exception":"[object] (ErrorException(code: 0): Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) at /var/www/app/Console/Commands/ImportCities.php:140)

It seems to be a 8.4 behavior change, so removing the logic would make it go away

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* fix(compose-modal): avoid WebGL if it's not needed

* fix(compose-modal): update webgl-media-editor

* New translations web.php (Hungarian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* Update .env.example

Adding the parameter INSTANCE_DISCOVER_PUBLIC="true" to prevent a HTTP 403 error at the explorer tab in the instance preview.

* New variable for lang spanish

* Variable for lang spanish

* Update Dockerfile, fixes pixelfed#5535 pixelfed#5559

* Fix pixelfed#5582

* Fix pixelfed#5632

* Update status twitter:card to summary_large_image for images/albums

* Update changelog

---------

Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* New translations web.php (Slovak)
[ci skip]

* New variable for lan spanish on auth, profile, helpcenter, navmenu and settings

* Update MediaController, fix redirect bug

* Correct some typos in Spanish translations

* add settings link in dropdown menu

* New translations web.php (French)
[ci skip]

* fix icon name

* Update resources/lang/es/navmenu.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/profile.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/profile.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/helpcenter.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/profile.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/helpcenter.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/profile.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/helpcenter.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/navmenu.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/helpcenter.php

Co-authored-by: Mackenzie <[email protected]>

* Update resources/lang/es/navmenu.php

Co-authored-by: Mackenzie <[email protected]>

* Add localization:generate command to generate the js/vue l10n files from the blade translations

* Move fallback media route

* Prevent pulse crash when it is not configured

* Update CuratedOnboarding, add new app:curated-onboarding command, extend email verification window to 7 days and fix resend verification mails

* Update CHANGELOG.md

* Add media:replacedomain command to replace S3 media urls

* add embed translation for lang es in file helpcenter.php and full file site.php translated to es

* minor fix in site.php lang es

* New translations web.php (Spanish)
[ci skip]

* Update DirectMessageController, fix performance issue

* Update DirectMessageController, fix query

* Fix curl

* New translations web.php (Bengali)
[ci skip]

* Update NewStatusPipeline, replaces pixelfed#5706

* Update NewStatusPipeline, improve fallback

* Update dev from

* add send weekly popular posts email (#24)

* add send weekly popular posts email.

* limit run in production

* hide landing page

* feat-dev: analytics feature (#25)

* hotfix: send email  just  production

* add app register

* update front build

* Update settings.php

* Update settings.php

* Update settings.php

* add missing keys

* adjust: fix pt navmenu.php

* Update iar.blade.php - Fix in-app reg without hcaptcha (pixelfed#5807)

* Staging (pixelfed#5674)

* Update .env.docker

Registry has changed. Old registry has been discontinued in August 2024. New Registry added, format of Docker tag has been adjusted as it now contains the Debian Release as well.

Sample Version is set to current stable but can be adjusted to any of the available branches.

* Update .env.docker

Stick major.minor according to https://jippi.github.io/docker-pixelfed/customize/tags/#pixelfed-version

Disable Debian Release Check until it's solved in dottie.

Closes pixelfed#5264

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* fix: don't restore memory limit after cities import

Since this command can only be invoked by CLI, the process will exit after a successful import, so restoring the transient PHP memory limit doesn't really have any affect.

In PHP 8.4, this throws the following error (which doesn't happen in 8.3 and below)

> [entrypoint / 11-first-time-setup.sh] - (stderr) 128769/128769 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%[2025-01-20 11:29:23] production.ERROR: Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) {"exception":"[object] (ErrorException(code: 0): Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) at /var/www/app/Console/Commands/ImportCities.php:140)

It seems to be a 8.4 behavior change, so removing the logic would make it go away

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* fix(compose-modal): avoid WebGL if it's not needed

* fix(compose-modal): update webgl-media-editor

* New translations web.php (Hungarian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* Update .env.example

Adding the parameter INSTANCE_DISCOVER_PUBLIC="true" to prevent a HTTP 403 error at the explorer tab in the instance preview.

* New variable for lang spanish

* Variable for lang spanish

* Update Dockerfile, fixes pixelfed#5535 pixelfed#5559

* Fix pixelfed#5582

* Fix pixelfed#5632

* Update status twitter:card to summary_large_image for images/albums

* Update changelog

---------

Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* Update iar.blade.php

---------

Co-authored-by: daniel <[email protected]>
Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* Update iar.blade.php - Fix in-app reg without hcaptcha (pixelfed#5807) (pixelfed#5808)

* Staging (pixelfed#5674)

* Update .env.docker

Registry has changed. Old registry has been discontinued in August 2024. New Registry added, format of Docker tag has been adjusted as it now contains the Debian Release as well.

Sample Version is set to current stable but can be adjusted to any of the available branches.

* Update .env.docker

Stick major.minor according to https://jippi.github.io/docker-pixelfed/customize/tags/#pixelfed-version

Disable Debian Release Check until it's solved in dottie.

Closes pixelfed#5264

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* fix: don't restore memory limit after cities import

Since this command can only be invoked by CLI, the process will exit after a successful import, so restoring the transient PHP memory limit doesn't really have any affect.

In PHP 8.4, this throws the following error (which doesn't happen in 8.3 and below)

> [entrypoint / 11-first-time-setup.sh] - (stderr) 128769/128769 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%[2025-01-20 11:29:23] production.ERROR: Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) {"exception":"[object] (ErrorException(code: 0): Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) at /var/www/app/Console/Commands/ImportCities.php:140)

It seems to be a 8.4 behavior change, so removing the logic would make it go away

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* fix(compose-modal): avoid WebGL if it's not needed

* fix(compose-modal): update webgl-media-editor

* New translations web.php (Hungarian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* Update .env.example

Adding the parameter INSTANCE_DISCOVER_PUBLIC="true" to prevent a HTTP 403 error at the explorer tab in the instance preview.

* New variable for lang spanish

* Variable for lang spanish

* Update Dockerfile, fixes pixelfed#5535 pixelfed#5559

* Fix pixelfed#5582

* Fix pixelfed#5632

* Update status twitter:card to summary_large_image for images/albums

* Update changelog

---------







* Update iar.blade.php

---------

Co-authored-by: Shlee <[email protected]>
Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* fix register

* 19 add analytics feature (#27)

* feat-dev: analytics feature

* upgrade version package

* upgrach commit package.lock

* change seguindo

* fix link

* fix conflics

* update notifications

* Add app register email verify resends

* Update composer

* Update changelog

* Update IG import command

* Add app register email verify resends (pixelfed#5814)

* Update iar.blade.php - Fix in-app reg without hcaptcha (pixelfed#5807)

* Staging (pixelfed#5674)

* Update .env.docker

Registry has changed. Old registry has been discontinued in August 2024. New Registry added, format of Docker tag has been adjusted as it now contains the Debian Release as well.

Sample Version is set to current stable but can be adjusted to any of the available branches.

* Update .env.docker

Stick major.minor according to https://jippi.github.io/docker-pixelfed/customize/tags/#pixelfed-version

Disable Debian Release Check until it's solved in dottie.

Closes pixelfed#5264

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* fix: don't restore memory limit after cities import

Since this command can only be invoked by CLI, the process will exit after a successful import, so restoring the transient PHP memory limit doesn't really have any affect.

In PHP 8.4, this throws the following error (which doesn't happen in 8.3 and below)

> [entrypoint / 11-first-time-setup.sh] - (stderr) 128769/128769 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%[2025-01-20 11:29:23] production.ERROR: Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) {"exception":"[object] (ErrorException(code: 0): Failed to set memory limit to 134217728 bytes (Current memory usage is 134746112 bytes) at /var/www/app/Console/Commands/ImportCities.php:140)

It seems to be a 8.4 behavior change, so removing the logic would make it go away

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Finnish)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* New translations web.php (Portuguese)
[ci skip]

* fix(compose-modal): avoid WebGL if it's not needed

* fix(compose-modal): update webgl-media-editor

* New translations web.php (Hungarian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* New translations web.php (Russian)
[ci skip]

* Update .env.example

Adding the parameter INSTANCE_DISCOVER_PUBLIC="true" to prevent a HTTP 403 error at the explorer tab in the instance preview.

* New variable for lang spanish

* Variable for lang spanish

* Update Dockerfile, fixes pixelfed#5535 pixelfed#5559

* Fix pixelfed#5582

* Fix pixelfed#5632

* Update status twitter:card to summary_large_image for images/albums

* Update changelog

---------

Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* Update iar.blade.php

---------

Co-authored-by: daniel <[email protected]>
Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* Add app register email verify resends

* Update composer

* Update changelog

* Update IG import command

---------

Co-authored-by: Shlee <[email protected]>
Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>

* Update App Register to expire codes after 4 hours instead of 60 minutes

* Update CHANGELOG.md

* Update AppServiceProvider.php

* Update AppRegisterController

* update web vars

* add missing keys

* Update

---------

Co-authored-by: root (Deneir) <root@deneir>
Co-authored-by: Daniel Supernault <[email protected]>
Co-authored-by: Dan Helfman <[email protected]>
Co-authored-by: Lioh Moeller <[email protected]>
Co-authored-by: Anil Kulkarni <[email protected]>
Co-authored-by: Medformatik <[email protected]>
Co-authored-by: Christian Winther <[email protected]>
Co-authored-by: Simon Laux <[email protected]>
Co-authored-by: Anil Kulkarni <[email protected]>
Co-authored-by: Shlee <[email protected]>
Co-authored-by: Taye Adeyemi <[email protected]>
Co-authored-by: Mackenzie Morgan <[email protected]>
Co-authored-by: Rm Yakovenko <[email protected]>
Co-authored-by: tercean <[email protected]>
Co-authored-by: stemy2 <[email protected]>
Co-authored-by: Uthanien <[email protected]>
Co-authored-by: Felipe Espinosa C. <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet