Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boynet's avatar

forge how to disable nginx default redirection?

inside nginx/forge-conf/be106.net/before/redirect.conf file there is this simple config:

server {
    listen 80;
    listen [::]:80;

    server_name www.my-domain.net;
    return 301 $scheme://my-domain.net$request_uri;
}

is there a simple way of removing this without altering the file itself(as it look like bad idea).

or removing the forge default line that including this config as it also bad idea

# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/be106.net/before/*;

I want the site to be accessible from different domains also

0 likes
2 replies
arctic-ice-cool's avatar

Did you ever get anywhere with this?

Not being able to use both www and non-www by default can sometimes be a problem.

NAM's avatar

Ditto. Any idea on how to accomplish this?

Presently I have to disable the forge-conf and add a new copy of it's contents (and modify that) into my sites nginx config - however, I have a feeling this will cause persistent problems with SSL certificates. I would at the very least recommend Forge reorganized the "before" forge-conf into perhaps two files, one with SSL and one without (if that's possible - I am no expert when it comes to nginx).

Please or to participate in this conversation.