This error occurs in the “v2.12.1” version of Nginx Proxy Manager when you try to add or modify a redirect host that uses “auto” as Schema value.
There is currently an open Issue on the NPM github that you can follow if you want to know the current status of the case:
https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4080
Solution:
The following is not a definitive solution but a way to “skip” the problem and be able to add your hosts. In the future, NPM developers should apply the solution directly in the code.
- Open Nginx Proxy Manager and create or edit the new redirect host.
- Before saving, activate the developer mode and locate in the HTML structure the Schema selector, or you can also use Google Chrome's Inspect option.
- With this you can now successfully save your host configuration. However, there are still a few additional steps to do to get it working properly.
- Now, you must access the files of your server where you have hosted your Nginx Proxy Manager and locate yourself in the directory
data/nginx/redirection_host
- There, open the configuration of the newly created/edited redirection host, in my case it is called 3.conf, make sure you select the one that corresponds to the one you want to modify.
- Once the configuration file is opened, locate a line similar to this one:
return 307 auto://whaterverisyourdomain.com$request_uri;
- Change the section of the URL that says “auto” to “$scheme”, so that it looks like this:
return 307 $scheme://whaterverisyourdomain.com$request_uri;
- Save the file and restart the proxy
It is important to note that this workaround must be done every time you are going to register or modify a redirection host. At least until NPM fixes this problem and you upgrade your server to the new version.