Skip to content

Custom 503 error page #275

@trescst

Description

@trescst

I am trying to customize the 503 error page that is being shown when for example you hit the nginx-proxy using its IP adress instead of a domain known to nginx-proxy, or when your backend container is not up-and-running due to an upgrade.

I edited the nginx.tmpl as follows, but this doesn't seem to be doing anything:

{{ end }}

server {
        server_name _; # This is just an invalid value which will never trigger on a real hostname.
        listen 80;
        access_log /var/log/nginx/access.log vhost;

        error_page 503 @503;
        return 503;
        location @503 {
          try_files /usr/share/nginx/html/maintenance.html =503;
        }
}

{{ if (and (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}

Anybody any suggestions on how to make this work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions