NGINX Redirect Config bug in ISPConfig 3.3.1p1

Discussion in 'Developers' Forum' started by Bay Internet, May 27, 2026.

  1. Bay Internet

    Bay Internet New Member

    When creating a Redirect, of Type Redirect in the control Panel, which is essentially a 302 redirect, the generated NGINX config file has a syntax error.

    The correct syntax is:
    rewrite ^(?!/(\.well-known/acme-challenge))/(.*)$ http://example.com/$2 redirect;

    However ISPconfig creates the directive without a "/" at the end of the domain name, like:
    rewrite ^(?!/(\.well-known/acme-challenge))/(.*)$ http://example.com$2 redirect;

    This results in example.com/test.html being re-written as example.comtest.html

    Also there is no newline after the redirect directive, so the next line in the config file is merged with the redirect like:
    rewrite ^(?!/(\.well-known/acme-challenge))/(.*)$ http://example.com$2 redirect; index index.html index.htm index.php index.cgi index.pl index.xhtml standard_index.html;

    Instead of:
    rewrite ^(?!/(\.well-known/acme-challenge))/(.*)$ http://example.com$/2 redirect;
    index index.html index.htm index.php index.cgi index.pl index.xhtml standard_index.html;

    This last one is just cosmetic, but if you're in there you may want to fix it also. :)
     
    ahrasis and till like this.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thank you for the report. I'll check it.
     
    ahrasis and Bay Internet like this.

Share This Page