[GH-ISSUE #466] Adding SSL when with AccessList results in bad Nginx config #392

Closed
opened 2026-02-26 06:32:40 +03:00 by kerem · 5 comments
Owner

Originally created by @cmitz on GitHub (Jun 19, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/466

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
  • Are you sure you're not using someone else's docker image?
  • [Yes, but with Access List] If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network?

Describe the bug

A clear and concise description of what the bug is.
When adding SSL with LetsEncrypt to a domain that has an AccessList, the system provides a LE Certificate but generates an invalid new config.

What version of Nginx Proxy Manager is reported on the login page?
v2.3.1

To Reproduce
Steps to reproduce the behavior:

  1. Make Access List with 1 allowed IP range
    1. Go to Access Lists
    2. Click on Add Access List
    3. Fill in a name
    4. Go to tab Access
    5. Fill in 192.168.1.0/24
    6. Click Save
  2. Make Domain
    1. Go to Hosts -> Proxy Hosts
    2. Click on Add Proxy Host
    3. Add a name, IP and port
    4. Select previously created access list
    5. Click Save
  3. Add SSL
    1. Click on the three dots -> Edit
    2. Go to tab SSL
    3. In SSL Certificate select "Request a new certificate with Let's Encrypt"
    4. Click Save
  4. See alert "Internal Error"
  5. The status of the proxy host is now "unkown"

To fix this, go back to open the Access List (edit) and just press Save without changing it. Disable and enable the proxy host again and all is well.

This happens also when:

  • Access Lists contained Basic Auth, no IP ranges
  • Proxy was newly created, not saved yes, before SSL with LE option was selected. After all fields were filled in Save was pressed

Expected behavior

I expected the dialog to close with no errors.

Screenshots

Screenshots with proxy 6:
image
image

Operating System

I use NginxProxyManager in a Docker setup using UnRaid (Ubuntu).

Additional context

The auto-generated, slightly censored config after adding the LE certificate:

# ------------------------------------------------------------

server {
  set $forward_scheme http;
  set $server         "192.168.1.42";
  set $port           8080;

  listen 80;
#listen [::]:80;

  server_name sub.domain.nl;

  access_log /data/logs/proxy_host-5.log proxy;

  location / {

    # Access Rules
    deny all;

    # Access checks must...
    ;

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_http_version 1.1;

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


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

The config after opening and saving the AccessList again:

# ------------------------------------------------------------

server {
  set $forward_scheme http;
  set $server         "192.168.1.42";
  set $port           8080;

  listen 80;
#listen [::]:80;

  server_name sub.domain.nl;

  access_log /data/logs/proxy_host-5.log proxy;

  location / {

    # Access Rules
    allow 192.168.1.0/24;
    allow 192.168.33.0/24;
    deny all;

    # Access checks must...
    satisfy any;

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_http_version 1.1;

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

  # Custom
  include /data/nginx/custom/server_proxy[.]conf;
}
Originally created by @cmitz on GitHub (Jun 19, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/466 ### Checklist - [x] Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - [x] Are you sure you're not using someone else's docker image? - [Yes, but with Access List] If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network? ### Describe the bug _A clear and concise description of what the bug is._ When adding SSL with LetsEncrypt to a domain that has an AccessList, the system provides a LE Certificate but generates an invalid new config. _What version of Nginx Proxy Manager is reported on the login page?_ **v2.3.1** **To Reproduce** Steps to reproduce the behavior: 1. Make Access List with 1 allowed IP range 1. Go to _Access Lists_ 1. Click on _Add Access List_ 1. Fill in a name 1. Go to tab _Access_ 1. Fill in `192.168.1.0/24` 1. Click Save 1. Make Domain 1. Go to _Hosts_ -> _Proxy Hosts_ 1. Click on _Add Proxy Host_ 1. Add a name, IP and port 1. Select previously created access list 1. Click _Save_ 1. Add SSL 1. Click on the three dots -> _Edit_ 1. Go to tab _SSL_ 1. In _SSL Certificate_ select "Request a new certificate with Let's Encrypt" 1. Click _Save_ 1. See alert "Internal Error" 1. The status of the proxy host is now "unkown" To fix this, go back to open the Access List (edit) and just press _Save_ without changing it. _Disable_ and _enable_ the proxy host again and all is well. This happens also when: - Access Lists contained Basic Auth, no IP ranges - Proxy was newly created, not saved yes, before SSL with LE option was selected. After all fields were filled in _Save_ was pressed ### Expected behavior I expected the dialog to close with no errors. ### Screenshots Screenshots with proxy 6: <img width="275" alt="image" src="https://user-images.githubusercontent.com/5594436/85176443-19fd3400-b27a-11ea-9435-a5556be5fc48.png"> <img width="733" alt="image" src="https://user-images.githubusercontent.com/5594436/85176474-2e413100-b27a-11ea-9b28-178dd41a1b08.png"> ### Operating System I use NginxProxyManager in a Docker setup using UnRaid (Ubuntu). ### Additional context The auto-generated, slightly censored config after adding the LE certificate: ```nginx # ------------------------------------------------------------ server { set $forward_scheme http; set $server "192.168.1.42"; set $port 8080; listen 80; #listen [::]:80; server_name sub.domain.nl; access_log /data/logs/proxy_host-5.log proxy; location / { # Access Rules deny all; # Access checks must... ; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_http_version 1.1; # Proxy! include conf.d/include/proxy.conf; } # Custom include /data/nginx/custom/server_proxy[.]conf; } ``` The config after opening and saving the AccessList again: ```nginx # ------------------------------------------------------------ server { set $forward_scheme http; set $server "192.168.1.42"; set $port 8080; listen 80; #listen [::]:80; server_name sub.domain.nl; access_log /data/logs/proxy_host-5.log proxy; location / { # Access Rules allow 192.168.1.0/24; allow 192.168.33.0/24; deny all; # Access checks must... satisfy any; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_http_version 1.1; # Proxy! include conf.d/include/proxy.conf; } # Custom include /data/nginx/custom/server_proxy[.]conf; } ```
kerem 2026-02-26 06:32:40 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@R0GGER commented on GitHub (Jun 29, 2020):

I am having exact same issues.. Can somebody patch this one?

<!-- gh-comment-id:651122788 --> @R0GGER commented on GitHub (Jun 29, 2020): I am having exact same issues.. Can somebody patch this one?
Author
Owner

@hlidar85 commented on GitHub (Aug 14, 2020):

I have the same problem here

<!-- gh-comment-id:674282718 --> @hlidar85 commented on GitHub (Aug 14, 2020): I have the same problem here
Author
Owner

@Baukebrenninkmeijer commented on GitHub (Sep 22, 2020):

Same problem!

<!-- gh-comment-id:696957481 --> @Baukebrenninkmeijer commented on GitHub (Sep 22, 2020): Same problem!
Author
Owner

@alex20465 commented on GitHub (Oct 22, 2020):

same problem

<!-- gh-comment-id:714068938 --> @alex20465 commented on GitHub (Oct 22, 2020): same problem
Author
Owner

@cmitz commented on GitHub (Oct 22, 2020):

This was fixed in 2.6.1 I think. https://github.com/jc21/nginx-proxy-manager/releases/tag/v2.6.1

At least for me it was :)

<!-- gh-comment-id:714294950 --> @cmitz commented on GitHub (Oct 22, 2020): This was fixed in 2.6.1 I think. https://github.com/jc21/nginx-proxy-manager/releases/tag/v2.6.1 At least for me it was :)
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#392
No description provided.