[GH-ISSUE #4028] Custom error pages not working #2623

Open
opened 2026-02-26 07:36:15 +03:00 by kerem · 2 comments
Owner

Originally created by @CYM-GS on GitHub (Sep 29, 2024).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4028

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
Whenever I add the server_proxy.conf file to /data/custom and fill it with my desired configurations:

...
error_page 505 /error_pages/505.html;

location /error_pages {
    alias /data/nginx/error_pages;
    internal;
}

It doesn't actually use it, the permissions have been check and since it works on my test nginx instance I am assuming something isn't right with NPM.

However, if added in the proxy under the advanced section, it will function.

Nginx Proxy Manager Version
v2.11.3

To Reproduce
Steps to reproduce the behavior:

  1. create the server_proxy.conf in /data/custom
  2. Enter the error page location like above
  3. Go to a subdomain configured with NPM
  4. the page will report the default 502 bad gateway with openresty instead the custom html file

Expected behavior
See the custom html file instead openresty default error page

Screenshots
{8917B66A-89BA-4AF3-A389-22834FEB8101}

Operating System

Additional context
Firefox 130.0.1 (64-bit)

Client: Docker Engine - Community
Version: 27.1.2
API version: 1.46
Go version: go1.21.13
Git commit: d01f264
Built: Mon Aug 12 11:50:12 2024
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 27.1.2
API version: 1.46 (minimum version 1.24)
Go version: go1.21.13
Git commit: f9522e5
Built: Mon Aug 12 11:50:12 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.20
GitCommit: 8fc6bcff51318944179630522a095cc9dbf9f353
runc:
Version: 1.1.13
GitCommit: v1.1.13-0-g58aa920
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Originally created by @CYM-GS on GitHub (Sep 29, 2024). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4028 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** Whenever I add the server_proxy.conf file to /data/custom and fill it with my desired configurations: ```conf ... error_page 505 /error_pages/505.html; location /error_pages { alias /data/nginx/error_pages; internal; } ``` It doesn't actually use it, the permissions have been check and since it works on my test nginx instance I am assuming something isn't right with NPM. However, if added in the proxy under the advanced section, it will function. **Nginx Proxy Manager Version** v2.11.3 **To Reproduce** Steps to reproduce the behavior: 1. create the server_proxy.conf in /data/custom 2. Enter the error page location like above 3. Go to a subdomain configured with NPM 4. the page will report the default 502 bad gateway with openresty instead the custom html file **Expected behavior** See the custom html file instead openresty default error page **Screenshots** ![{8917B66A-89BA-4AF3-A389-22834FEB8101}](https://github.com/user-attachments/assets/9fd54c10-68c9-4e66-b9b4-105d348534b9) **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> **Additional context** Firefox 130.0.1 (64-bit) Client: Docker Engine - Community Version: 27.1.2 API version: 1.46 Go version: go1.21.13 Git commit: d01f264 Built: Mon Aug 12 11:50:12 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 27.1.2 API version: 1.46 (minimum version 1.24) Go version: go1.21.13 Git commit: f9522e5 Built: Mon Aug 12 11:50:12 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.20 GitCommit: 8fc6bcff51318944179630522a095cc9dbf9f353 runc: Version: 1.1.13 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
Author
Owner

@CYM-GS commented on GitHub (Sep 30, 2024):

can confirm somethig is worng with the include /data/nginx/custom/server_proxy[.]conf;

....
    # Proxy!
    include conf.d/include/proxy.conf;
  }


  # Custom
  include /data/nginx/custom/server_proxy[.]conf;

  error_page 400 /error_pages/400.html;
  error_page 401 /error_pages/401.html;
  error_page 402 /error_pages/401.html;
  error_page 403 /error_pages/403.html;
  error_page 404 /error_pages/404.html;
  error_page 405 /error_pages/405.html;
  error_page 407 /error_pages/407.html;
  error_page 408 /error_pages/408.html;
  error_page 409 /error_pages/409.html;
  error_page 410 /error_pages/410.html;
  error_page 411 /error_pages/411.html;
  error_page 412 /error_pages/412.html;
  error_page 413 /error_pages/413.html;
  error_page 416 /error_pages/416.html;
  error_page 418 /error_pages/418.html;
  error_page 429 /error_pages/429.html;
  error_page 500 /error_pages/500.html;
  error_page 501 /error_pages/501.html;
  error_page 502 /error_pages/502.html;
  error_page 503 /error_pages/503.html;
  error_page 504 /error_pages/504.html;
  error_page 505 /error_pages/505.html;

  location /error_pages {
      alias /data/nginx/error_pages/;
      internal;
  }
  
}

The error_page part is also in the server_proxy.conf but isn't working, but manually adding this to the proxy host conf works.

<!-- gh-comment-id:2383012065 --> @CYM-GS commented on GitHub (Sep 30, 2024): can confirm somethig is worng with the `include /data/nginx/custom/server_proxy[.]conf;` ``` .... # Proxy! include conf.d/include/proxy.conf; } # Custom include /data/nginx/custom/server_proxy[.]conf; error_page 400 /error_pages/400.html; error_page 401 /error_pages/401.html; error_page 402 /error_pages/401.html; error_page 403 /error_pages/403.html; error_page 404 /error_pages/404.html; error_page 405 /error_pages/405.html; error_page 407 /error_pages/407.html; error_page 408 /error_pages/408.html; error_page 409 /error_pages/409.html; error_page 410 /error_pages/410.html; error_page 411 /error_pages/411.html; error_page 412 /error_pages/412.html; error_page 413 /error_pages/413.html; error_page 416 /error_pages/416.html; error_page 418 /error_pages/418.html; error_page 429 /error_pages/429.html; error_page 500 /error_pages/500.html; error_page 501 /error_pages/501.html; error_page 502 /error_pages/502.html; error_page 503 /error_pages/503.html; error_page 504 /error_pages/504.html; error_page 505 /error_pages/505.html; location /error_pages { alias /data/nginx/error_pages/; internal; } } ``` The **error_page** part is also in the server_proxy.conf but isn't working, but manually adding this to the proxy host conf works.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 13, 2026):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:3741467632 --> @github-actions[bot] commented on GitHub (Jan 13, 2026): Issue is now considered stale. If you want to keep it open, please comment :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#2623
No description provided.