I cannot rewrite my URL (query string?)

Please use this template for troubleshooting questions.

My issue:

I cannot change my URL e.g. /dfdrgr.php?page=dfgfg to /rrrr. I’ve a .txt file contained e.g. /rrrr /dfdrgr.php?page=dfgfg; and a redirected.map file contained

# Redirects map file – auto generated
include /home/fxg/conf/web/ron.click/redirects.txt;
And a redirects.conf contaned:

# Nginx map block – auto generated

map $uri $rewrite_target {
    default "";
    include /home/fxg/conf/web/ron.click/redirects.map;
}

map $rewrite_target $should_redirect {
    ""      0;
    default 1;
}

The nginx.conf is contained:

#=========================================================================#

Default Web Domain Template

DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS






#=========================================================================#

server {
listen      88.121.229.139:80;
server_name ron.click ;
error_log   /var/log/apache2/domains/ron.click.error.log error;
    if ($should_redirect) {
    return 307 https://$server_name$rewrite_target;
}

    include /home/fxg/conf/web/ron.click/nginx.forcessl.conf*;

    location ~ /\.(?!well-known\/|file) {
            deny all;
            return 404;
    }

    location / {
            proxy_pass http://88.121.229.139:8080;

            location ~* ^.+\.(css|htm|html|js|mjs|json|xml|apng|avif|bmp|cur|gif|ico|jfif|jpg|jpeg|pjp|pjpeg|png|svg|tif|tiff|webp|aac|caf|flac|m4a|midi|mp3|ogg|opus|wav|3gp|av1|avi|m4v|mkv|mov|mpg|mpeg|mp4|mp4v|webm|otf|ttf|woff|woff2|doc|docx|odf|odp|ods|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx|7z|bz2|gz|rar|tar|tgz|zip|apk|appx|bin|dmg|exe|img|iso|jar|msi|webmanifest)$ {
                    try_files  $uri @fallback;

                    root       /home/fxg/web/ron.click/public_html;
                    access_log /var/log/apache2/domains/ron.click.log combined;
                    access_log /var/log/apache2/domains/ron.click.bytes bytes;

                    expires    max;
            }
    }

    location @fallback {
            proxy_pass http://88.121.229.139:8080;
    }

    location /error/ {
            alias /home/fxg/web/ron.click/document_errors/;
    }

    include /home/fxg/conf/web/ron.click/nginx.conf_*;

}
and nginx.ssl.conf:

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

server {
        listen      88.121.229.139:443 ssl;
        server_name ron.click ;
        error_log   /var/log/apache2/domains/ron.click.error.log error;

        ssl_certificate     /home/fxg/conf/web/ron.click/ssl/ron.click.pem;
        ssl_certificate_key /home/fxg/conf/web/ron.click/ssl/ron.click.key;
        ssl_stapling        on;
        ssl_stapling_verify on;

        # TLS 1.3 0-RTT anti-replay
        if ($anti_replay = 307) { return 307 https://$host$request_uri; }
        if ($anti_replay = 425) { return 425; }

        if ($should_redirect) {
        rewrite ^ $rewrite_target break;
        proxy_pass https://88.121.229.139:8443;
        break;
    }

        include /home/fxg/conf/web/ron.click/nginx.hsts.conf*;

        location ~ /\.(?!well-known\/|file) {
                deny all;
                return 404;
        }

        location / {
                proxy_ssl_server_name on;
                proxy_ssl_name $host;
                proxy_pass https://88.121.229.139:8443;

                location ~* ^.+\.(css|htm|html|js|mjs|json|xml|apng|avif|bmp|cur|gif|ico|jfif|jpg|jpeg|pjp|pjpeg|png|svg|tif|tiff|webp|aac|caf|flac|m4a|midi|mp3|ogg|opus|wav|3gp|av1|avi|m4v|mkv|mov|mpg|mpeg|mp4|mp4v|webm|otf|ttf|woff|woff2|doc|docx|odf|odp|ods|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx|7z|bz2|gz|rar|tar|tgz|zip|apk|appx|bin|dmg|exe|img|iso|jar|msi|webmanifest)$ {
                        try_files  $uri @fallback;

                        root       /home/fxg/web/ron.click/public_html;
                        access_log /var/log/apache2/domains/ron.click.log combined;
                        access_log /var/log/apache2/domains/ron.click.bytes bytes;

                        expires    max;
                }
        }

        location @fallback {
                proxy_ssl_server_name on;
                proxy_ssl_name $host;
                proxy_pass https://88.121.229.139:8443;
        }

        location /error/ {
                alias /home/fxg/web/ron.click/document_errors/;
        }

        proxy_hide_header Upgrade;

        include /home/fxg/conf/web/ron.click/nginx.ssl.conf_*;
}

How I encountered the problem:

There is no problem in running the nginx but I get 404 error in my browser for https://ron.click/rrrr. I tested it using nginx -t but more probably I’m doing something wrong in nginx.conf or nginx.ssl.conf or redirection.conf. I’m using Hestia.

Solutions I’ve tried:

Version of NGINX or NGINX adjacent software (e.g. NGINX Gateway Fabric):

1.29.3

Deployment environment:

Minimal NGINX config to reproduce your issue (preferably running on https://tech-playground.com/playgrounds/nginx for ease of debugging, and if not as a code block): (Tip → Run nginx -T to print your entire NGINX config to your terminal.)

NGINX access/error log: (Tip → You can usually find the logs in the /var/log/nginx directory.) for error log: 2025/12/09 19:35:32 [emerg] 1700546#1700546: “proxy_pass” directive is not allow ed here in /etc/nginx/conf.d/domains/ron.click.ssl.conf:23
2025/12/09 19:35:38 [emerg] 1735085#1735085: “proxy_pass” directive is not allow ed here in /etc/nginx/conf.d/domains/ron.click.ssl.conf:23
2025/12/09 19:36:18 [emerg] 1735692#1735692: “proxy_pass” directive is not allow ed here in /etc/nginx/conf.d/domains/ron.click.ssl.conf:23

You should really start by correcting those error log entries:

“proxy_pass” directive is not allowed here in /etc/nginx/conf.d/domains/ron.click.ssl.conf:23

Which refers to this config snippet

    if ($should_redirect) {
        rewrite ^ $rewrite_target break;
        proxy_pass https://88.121.229.139:8443;
        break;
    }

proxy_pass can only occur in if blocks when the if is within a location block.
See Module ngx_http_proxy_module

So the config you shared is not applied to your nginx instance. Let’s fix that before troubleshooting anything else!

Removed proxy_pass https://88.121.229.139:8443; in the if block. doesn’t work yet.

These autogenerated files don’t look nginx native. If they are created by Hestia you might have more luck asking that community.

I can’t see any evidence of the /rrrr rewrite rule you’re trying to create. Perhaps you could dump the entire nginx -T output instead?

Oh, I was working on it. I included it before server. nginx -T is showing me that everything is ok.

Here is the last nginx.conf:

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

include /home/fxg/conf/web/ron.click/redirects.conf;

server {
        listen      88.121.229.139:80;
        server_name ron.click ;
        error_log   /var/log/apache2/domains/ron.click.error.log error;

        include /home/fxg/conf/web/ron.click/nginx.forcessl.conf*;
        rewrite_log on;
        error_log /var/log/nginx/localhost.error_log notice;
        if ($should_redirect) {
            return 307 https://$server_name$rewrite_target;
        }

        location ~ /\.(?!well-known\/|file) {
                deny all;
                return 404;
        }

        location / {

                proxy_pass http://88.121.229.139:8080;

                location ~* ^.+\.(css|htm|html|js|mjs|json|xml|apng|avif|bmp|cur|gif|ico|jfif|jpg|jpeg|pjp|pjpeg|png|svg|tif|tiff|webp|aac|caf|flac|m4a|midi|mp3|ogg|opus|wav|3gp|av1|avi|m4v|mkv|mov|mpg|mpeg|mp4|mp4v|webm|otf|ttf|woff|woff2|doc|docx|odf|odp|ods|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx|7z|bz2|gz|rar|tar|tgz|zip|apk|appx|bin|dmg|exe|img|iso|jar|msi|webmanifest)$ {
                        try_files  $uri @fallback;

                        root       /home/fxg/web/ron.click/public_html;
                        access_log /var/log/apache2/domains/ron.click.log combined;
                        access_log /var/log/apache2/domains/ron.click.bytes bytes;

                        expires    max;
                }
        }

        location @fallback {
                proxy_pass http://88.121.229.139:8080;
        }

        location /error/ {
                alias /home/fxg/web/ron.click/document_errors/;
        }

        include /home/fxg/conf/web/ron.click/nginx.conf_*;
}

And the last nginx.ssl.conf:

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

include /home/fxg/conf/web/ron.click/redirects.conf;

server {
        listen      88.121.229.139:443 ssl;
        server_name ron.click ;
        error_log   /var/log/apache2/domains/ron.click.error.log error;

        ssl_certificate     /home/fxg/conf/web/ron.click/ssl/ron.click.pem;
        ssl_certificate_key /home/fxg/conf/web/ron.click/ssl/ron.click.key;
        ssl_stapling        on;
        ssl_stapling_verify on;
        rewrite_log on;
        error_log /var/log/nginx/localhost.error_log notice;
        # TLS 1.3 0-RTT anti-replay
        if ($anti_replay = 307) { return 307 https://$host$request_uri; }
        if ($anti_replay = 425) { return 425; }



        include /home/fxg/conf/web/ron.click/nginx.hsts.conf*;

        location ~ /\.(?!well-known\/|file) {
                deny all;
                return 404;
        }

        if ($rewrite_target) {
                rewrite ^ $rewrite_target break;

            }

        location / {
                proxy_ssl_server_name on;
                proxy_ssl_name $host;

                proxy_pass https://88.121.229.139:8443;

                location ~* ^.+\.(css|htm|html|js|mjs|json|xml|apng|avif|bmp|cur|gif|ico|jfif|jpg|jpeg|pjp|pjpeg|png|svg|tif|tiff|webp|aac|caf|flac|m4a|midi|mp3|ogg|opus|wav|3gp|av1|avi|m4v|mkv|mov|mpg|mpeg|mp4|mp4v|webm|otf|ttf|woff|woff2|doc|docx|odf|odp|ods|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx|7z|bz2|gz|rar|tar|tgz|zip|apk|appx|bin|dmg|exe|img|iso|jar|msi|webmanifest)$ {
                        try_files  $uri @fallback;

                        root       /home/fxg/web/ron.click/public_html;
                        access_log /var/log/apache2/domains/ron.click.log combined;
                        access_log /var/log/apache2/domains/ron.click.bytes bytes;

                        expires    max;
                }
        }

        location @fallback {
                proxy_ssl_server_name on;
                proxy_ssl_name $host;
                proxy_pass https://88.121.229.139:8443;
        }

        location /error/ {
                alias /home/fxg/web/ron.click/document_errors/;
        }

        proxy_hide_header Upgrade;

        include /home/fxg/conf/web/ron.click/nginx.ssl.conf_*;
}

And a redirects.conf:

map $uri $rewrite_target {
    default "";
    include /home/fxg/conf/web/ron.click/redirects.map;
}

map $rewrite_target $should_redirect {
    ""      0;
    default 1;
}

And in the redirected.map:

include /home/fxg/conf/web/ron.click/redirects.txt;

And finally redirects.txt:

/rrrr /dfdrgr.php?page=dfgfg;

It looks like it’s working but for pages without query string e.g. if we want to call https://ron.click/dfdrgr.php using https://ron.click/rrrr

I see it all now - thank you. That’s a lot of nested include files! :slight_smile:

Ultimately, everything in your rewrites.txt file is being passed to the rewrite directive. rewrite modifies the URI only, not the query params.

So if you also want to change the query params I think you’ll need to create two paths in the config. One path that doesn’t change the query (current config) and another path that explicitly sets the URI and query params for the proxy_pass directive.

You can use another map block to determine if the query params should be rewritten:

map $uri $query_target {
    default "";
    /rrrr page=dfgfg;
}
…
    location / {
        if ( $query_target != "" ) {
            proxy_pass https://88.121.229.139:8443$rewrite_target?$query_target;
        }
        #rest of existing config

This is untested. Give it a try.

In fact I may have that all wrong!

If a replacement string includes the new request arguments, the previous request arguments are appended after them. If this is undesired, putting a question mark at the end of a replacement string avoids having them appended, for example:

rewrite ^/users/(.*)$ /show?user=$1? last;

So it should just work. You may want to enable rewrite_log on; to see exactly what’s going on.

I changed the nginx.ssl.conf and enabled the debug. Here is the code:

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

include /home/fxg/conf/web/ron.click/redirects.conf;

server {
    listen      88.121.229.139::443 ssl;
    server_name ron.click ;

    
    error_log   /var/log/apache2/domains/ron.click.error.log error;

    
    error_log   /var/log/nginx/ron_trace.log notice;

    rewrite_log on;

    
    set $trace_phase "server_start";
    set $trace_location "server";
    set $trace_uri_before $request_uri;

    ssl_certificate     /home/fxg/conf/web/ron.click/ssl/ron.click.pem;
    ssl_certificate_key /home/fxg/conf/web/ron.click/ssl/ron.click.key;

    # TLS 1.3 0-RTT anti-replay
    if ($anti_replay = 307) { return 307 https://$host$request_uri; }
    if ($anti_replay = 425) { return 425; }

    include /home/fxg/conf/web/ron.click/nginx.hsts.conf*;

    
    if ($rewrite_target) {
        set $trace_phase "server_rewrite";
        set $trace_location "server_rewrite";
        set $trace_uri_before "$uri?$args";
        rewrite ^ $rewrite_target break;
    }

    location ~ /\.(?!well-known\/|file) {
        set $trace_location "hidden_files";
        add_header X-Trace-URI-Before "$trace_uri_before" always;
        add_header X-Trace-Location "$trace_location" always;
        add_header X-Trace-Phase "$trace_phase" always;
        deny all;
        return 404;
    }

    location ~ \.php$ {
        set $trace_location "php_location";
        set $trace_phase "php_direct";

        proxy_ssl_server_name on;
        proxy_ssl_name $host;
        proxy_pass https://88.121.229.139::8443;

        add_header X-Trace-Phase "$trace_phase" always;
        add_header X-Trace-Location "$trace_location" always;
        add_header X-Trace-URI "$uri" always;
        add_header X-Trace-Args "$args" always;
        add_header X-Trace-URI-Before "$trace_uri_before" always;
        add_header X-Trace-Rewrite-Target "$rewrite_target" always;
    }

    location / {
        set $trace_location "root_location";

     
        if ($trace_phase = "server_start") {
            set $trace_phase "no_rewrite";
        }

        proxy_ssl_server_name on;
        proxy_ssl_name $host;

   
        add_header X-Trace-Location "$trace_location" always;
        add_header X-Trace-Phase "$trace_phase" always;
        add_header X-Trace-URI "$uri" always;
        add_header X-Trace-Args "$args" always;
        add_header X-Trace-Rewrite-Target "$rewrite_target" always;
        add_header X-Trace-URI-Before "$trace_uri_before" always;

        proxy_pass https://88.121.229.139::8443;

        location ~* ^.+\.(css|htm|html|js|mjs|json|xml|apng|avif|bmp|cur|gif|ico|jfif|jpg|jpeg|pjp|pjpeg|png|svg|tif|tiff|webp|aac|caf|flac|m4a|midi|mp3|ogg|opus|wav|3gp|av1|avi|m4v|mkv|mov|mpg|mpeg|mp4|mp4v|webm|otf|ttf|woff|woff2|doc|docx|odf|odp|ods|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx|7z|bz2|gz|rar|tar|tgz|zip|apk|appx|bin|dmg|exe|img|iso|jar|msi|webmanifest)$ {
            set $trace_location "static_files";

            try_files  $uri @fallback;

            root       /home/fxg/web/ron.click/public_html;
            access_log /var/log/apache2/domains/ron.click.log combined;
            access_log /var/log/apache2/domains/ron.click.bytes bytes;

            expires    max;

            add_header X-Trace-Location "$trace_location" always;
            add_header X-Trace-Phase "$trace_phase" always;
            add_header X-Trace-URI-Before "$trace_uri_before" always;
            add_header X-Trace-URI "$uri" always;
        }
    }

    location @fallback {
        set $trace_location "fallback_location";
        set $trace_phase "fallback";

        proxy_ssl_server_name on;
        proxy_ssl_name $host;
        proxy_pass https://88.121.229.139::8443;

        add_header X-Trace-Phase "$trace_phase" always;
        add_header X-Trace-Location "$trace_location" always;
        add_header X-Trace-URI-Before "$trace_uri_before" always;
        add_header X-Trace-URI "$uri" always;
    }

    location /error/ {
        set $trace_location "error_pages";
        set $trace_phase "error";

        alias /home/fxg/web/ron.click/document_errors/;

        add_header X-Trace-Phase "$trace_phase" always;
        add_header X-Trace-Location "$trace_location" always;
        add_header X-Trace-URI-Before "$trace_uri_before" always;
        add_header X-Trace-URI "$uri" always;
    }

    proxy_hide_header Upgrade;

    include /home/fxg/conf/web/ron.click/nginx.ssl.conf_*;
}

And the output:

2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/rrrr", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/rrrr", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "\.php$" does not match "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 "^" matches "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [notice] 2279459#2279459: *4421 rewritten data: "/dfdrgr.php?page=dfgfg", args: "", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"
2025/12/11 17:14:02 [error] 2279459#2279459: *4421 rewrite or internal redirection cycle while processing "/dfdrgr.php?page=dfgfg", client: 2a02:4540:5047:6d60:e003:62d2:940a:d10f, server: ron.click, request: "GET /rrrr HTTP/2.0", host: "ron.click"

Infinite loop?

Your 404 is coming from invalid config, not the rewrite itself.
proxy_pass is not allowed inside an if block, which is exactly what your error log is telling you. Because of that, the redirect never runs.

Move the rewrite/redirect logic into a location block (or use a simple return 301/307 without proxy_pass). Once you remove proxy_pass from the if, the mapping will work as expected.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.