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

Error 500 On Service Start #1163

Closed
SkylerGhostly opened this issue Mar 26, 2024 · 1 comment
Closed

Error 500 On Service Start #1163

SkylerGhostly opened this issue Mar 26, 2024 · 1 comment

Comments

@SkylerGhostly
Copy link

SkylerGhostly commented Mar 26, 2024

Bug description

When starting another container that uses nginx-proxy and nginx-letsencrypt, for about 20-30 seconds while either the container starts or nginx-proxy generates the config, users see a error 500 page. This can be alarming to end users and doesn't look very professional.

Is there a way to prevent this from happening, or is there a way to override this? I've tried adding a custom error 500 but since the error itself is within nginx-proxy while either generating configs or when contacting the upstream, I can't find a way to override this or prevent it.

Any help is much appreciated. Thank you.

EDIT: I'm aware I could fiddle with nginx.tmpl but having to re-apply this change every time this file is updated in the repository is extremely cumbersome.


Info: running acme-companion version v2.2.10-13-gb22b6ef

nginx-proxy's Docker configuration

docker-compose.yml

services:
  nginx-proxy:
    image: nginxproxy/nginx-proxy
    container_name: nginx-proxy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro

      - ./error_pages:/usr/share/nginx/html/error_pages
      - ./error_pages/error_pages.conf:/etc/nginx/conf.d/error_pages.conf
      - ./nginx-custom.conf:/etc/nginx/conf.d/my_proxy.conf

      - nginx-vhost:/etc/nginx/vhost.d
      - nginx-html:/usr/share/nginx/html
      - nginx-certs:/etc/nginx/certs:ro
      - nginx-conf:/etc/nginx/conf.d

  nginx-letsencrypt:
    image: nginxproxy/acme-companion
    container_name: nginx-letsencrypt
    restart: unless-stopped
    volumes_from:
      - nginx-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - nginx-certs:/etc/nginx/certs:rw
      - nginx-acme-sh:/etc/acme.sh
    environment:
      - DEFAULT_EMAIL=email@example.com
      - NGINX_PROXY_CONTAINER=nginx-proxy
      - TRUST_DOWNSTREAM_PROXY=false

volumes:
  nginx-vhost:
  nginx-html:
  nginx-certs:
  nginx-conf:
  nginx-acme-sh:

networks:
  default:
    name: nginx-proxy
    external: true

error_pages.conf

error_page 500 /500.html;
location = /500.html {
    root /usr/share/nginx/html/error_pages;
    internal;
}

error_page 502 /502.html;
location = /502.html {
    root /usr/share/nginx/html/error_pages;
    internal;
}

error_page 503 /503.html;
location = /503.html {
    root /usr/share/nginx/html/error_pages;
    internal;
}

nginx-custom.conf

server_tokens off;
client_max_body_size 1024m;
proxy_buffering    off;
proxy_buffer_size  128k;
proxy_buffers 100  128k;

Docker host

  • OS: Debian 12 Bookworm (6.1.0-18-amd64)
  • Docker version: 26.0.0
@buchdag buchdag transferred this issue from nginx-proxy/acme-companion Apr 1, 2024
@buchdag buchdag linked a pull request Nov 3, 2024 that will close this issue
@buchdag buchdag transferred this issue from nginx-proxy/nginx-proxy Nov 4, 2024
@buchdag
Copy link
Member

buchdag commented Nov 4, 2024

Hi, this was fixed in #1157 : acme-companion no longer generate a default certificate for nginx-proxy, which mean you should no longer get the 500 error if you remove default.crt and default.key from /etc/nginx/certs and use the latest tag of acme-companion (a new version with the fix will be released soon).

@buchdag buchdag closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants