NGINX always shows the welcome page

I’ve set up a vserver at a hoster with debian 12 and installed ngninx (apt install ngninx).
Then I’ve configured a dyndns service to access my server, the server has IPv4 and IPv6 adresses:
server1.dyn1.test (expample, not working :wink: )
The domain has only the IPv6 adress.

My homeserver is only accessable via IPv6. I’ve set up another dyndns server (other provider) to access the server:
server2.dny2.test

http://server2.dny2.test is accessable from the vserver.

Then I did the configuration:

/etc/nginx/sites-available/server1.dyn1.test 

server {
   listen 80 default_server;
   server_name _;

   return 444;
}

server {
   listen 80;
   server_name server1.dyn1.test;

   location / {
      proxy_pass http://server2.dny2.test;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
   }
}


I’ve created the symlink from sites-enabled to the sites-available config file.

in the nginx.conf I’ve added

 include /etc/nginx/sites-enabled/*;

Wenn I try to open http://server1.dyn1.test I always get the nginx welcome page.
Tried to figure out what’s wrong via chatGPT, but everything it suggested was OK.

any idea what I should check? Could it be the problem, that I access nginx via IPv4 and it should forward the traffic to an IPv6 only server?

Hey @Merlin123! First things first, can you try installing NGINX from our repository instead of the Debian repository? The Debian 12/bookworm build is four years old at this point and the version disparity makes troubleshooting harder.

In so far as your issue, I just want to double check you have tried to reload NGINX’s config using nginx -s reload? In addition, you mention your servers have IPv6 addresses. However, your NGINX config is set up for IPv4, not IPv6. Our docs cover how to enable it.

If neither of these suggestions prove to be useful, can you share your entire NGINX config using nginx -T or replicate your environment in https://tech-playground.com/playgrounds/nginx/? This will make it much easier to help you out.

2 Likes

I’ll reinstall nginx. Didn’t know, that the version in the Debian repo is so old.

Tried nginx -s reload without any change

config:

root@my-vps:~# nginx -T
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}


# configuration file /etc/nginx/mime.types:

types {
    text/html                                        html htm shtml;
    text/css                                         css;
    text/xml                                         xml;
    image/gif                                        gif;
    image/jpeg                                       jpeg jpg;
    application/javascript                           js;
    application/atom+xml                             atom;
    application/rss+xml                              rss;

    text/mathml                                      mml;
    text/plain                                       txt;
    text/vnd.sun.j2me.app-descriptor                 jad;
    text/vnd.wap.wml                                 wml;
    text/x-component                                 htc;

    image/avif                                       avif;
    image/png                                        png;
    image/svg+xml                                    svg svgz;
    image/tiff                                       tif tiff;
    image/vnd.wap.wbmp                               wbmp;
    image/webp                                       webp;
    image/x-icon                                     ico;
    image/x-jng                                      jng;
    image/x-ms-bmp                                   bmp;

    font/woff                                        woff;
    font/woff2                                       woff2;

    application/java-archive                         jar war ear;
    application/json                                 json;
    application/mac-binhex40                         hqx;
    application/msword                               doc;
    application/pdf                                  pdf;
    application/postscript                           ps eps ai;
    application/rtf                                  rtf;
    application/vnd.apple.mpegurl                    m3u8;
    application/vnd.google-earth.kml+xml             kml;
    application/vnd.google-earth.kmz                 kmz;
    application/vnd.ms-excel                         xls;
    application/vnd.ms-fontobject                    eot;
    application/vnd.ms-powerpoint                    ppt;
    application/vnd.oasis.opendocument.graphics      odg;
    application/vnd.oasis.opendocument.presentation  odp;
    application/vnd.oasis.opendocument.spreadsheet   ods;
    application/vnd.oasis.opendocument.text          odt;
    application/vnd.openxmlformats-officedocument.presentationml.presentation
                                                     pptx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                                                     xlsx;
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
                                                     docx;
    application/vnd.wap.wmlc                         wmlc;
    application/wasm                                 wasm;
    application/x-7z-compressed                      7z;
    application/x-cocoa                              cco;
    application/x-java-archive-diff                  jardiff;
    application/x-java-jnlp-file                     jnlp;
    application/x-makeself                           run;
    application/x-perl                               pl pm;
    application/x-pilot                              prc pdb;
    application/x-rar-compressed                     rar;
    application/x-redhat-package-manager             rpm;
    application/x-sea                                sea;
    application/x-shockwave-flash                    swf;
    application/x-stuffit                            sit;
    application/x-tcl                                tcl tk;
    application/x-x509-ca-cert                       der pem crt;
    application/x-xpinstall                          xpi;
    application/xhtml+xml                            xhtml;
    application/xspf+xml                             xspf;
    application/zip                                  zip;

    application/octet-stream                         bin exe dll;
    application/octet-stream                         deb;
    application/octet-stream                         dmg;
    application/octet-stream                         iso img;
    application/octet-stream                         msi msp msm;

    audio/midi                                       mid midi kar;
    audio/mpeg                                       mp3;
    audio/ogg                                        ogg;
    audio/x-m4a                                      m4a;
    audio/x-realaudio                                ra;

    video/3gpp                                       3gpp 3gp;
    video/mp2t                                       ts;
    video/mp4                                        mp4;
    video/mpeg                                       mpeg mpg;
    video/quicktime                                  mov;
    video/webm                                       webm;
    video/x-flv                                      flv;
    video/x-m4v                                      m4v;
    video/x-mng                                      mng;
    video/x-ms-asf                                   asx asf;
    video/x-ms-wmv                                   wmv;
    video/x-msvideo                                  avi;
}

# configuration file /etc/nginx/sites-enabled/karakeep:
server {
    listen 80;
    server_name server1.dyn1.test;

    location / {
        proxy_pass http://server2.dyn2.test;

        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_redirect off;
    }
}


I’ve edited your answer to remove some potential sensitive data. Hope you don’t mind! I also made an edit to my previous reply so you might have missed it whilst replying – the issue might also be due to NGINX being configured to only listen on IPv4 whilst your servers are configured to only use IPv6.

Can you also share your access and error logs? They should be under /var/log/nginx.

Ok. Reinstalled nginx, same behaviour.
IPv6: What if the computer trying to open the webpage can’t use IPv6? I’m setting up this server to be able to access my IPv6 pages with an IPv4 only client. Isn’t this possible?

Playground: Never used it before. I could paste my nginx.conf, but where should I paste my server configs?

access.log (part of my last test)

94.31.117.239 - - [05/Aug/2025:13:33:04 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36" "-"
91.224.92.17 - - [05/Aug/2025:13:40:05 +0000] "GET / HTTP/1.1" 200 615 "-" "-" "-"

error.log

2025/08/05 13:30:27 [notice] 12144#12144: using the "epoll" event method
2025/08/05 13:30:27 [notice] 12144#12144: nginx/1.28.0
2025/08/05 13:30:27 [notice] 12144#12144: built by gcc 12.2.0 (Debian 12.2.0-14)
2025/08/05 13:30:27 [notice] 12144#12144: OS: Linux 6.1.0-37-amd64
2025/08/05 13:30:27 [notice] 12144#12144: getrlimit(RLIMIT_NOFILE): 1024:524288
2025/08/05 13:30:27 [notice] 12145#12145: start worker processes
2025/08/05 13:30:27 [notice] 12145#12145: start worker process 12146


You would need to have your first server be able to listen on IPv4, and then proxy to the one listening on IPv6. Per your first comment my understanding is that the server1.dyn1.test domain is only set to use the IPv6 address from your server?

yes. server1 in my home network is only accessable via IPv6 and the dyndns service only returns a IPv6 address

server2 (my vserver in the internet) is accessable via IPv4 and the dyndns returns an IPv4 adress

Right, so in that case you need something like:

# configuration file /etc/nginx/sites-enabled/karakeep:
server {
    listen 80;
    server_name IPv4.server;

    location / {
        proxy_pass IPv4orIPv6.server;

        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_redirect off;
    }
}

hmmm… looks exactly like my config:

server {
    listen 80;
    server_name ipv4-server.duckdns.org;

    location / {
        proxy_pass http://ipv6-server.ipv64.de;

        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_redirect off;
    }
}

Or can you see a difference?

EDIT:
Copied your version and replaced ther server names → no difference, still the welcome page

If you visit http://ipv6-server.ipv64.de directly I assume you can see your site just fine? Your NGINX config should be proxying to the server no matter what if you hit ipv4-server.duckdns.org directly?

yes, from my laptop it’ working.
and a
curl -6 http://ipv6-server.ipv64.de
on my ipv4 server
returns the right content, so it should be accessable without any issues

Based on everything you have been sharing and your logs, the config should really work just fine. Everything seems to be pointing to your NGINX config not being reloaded. You should be seeing something along the lines of the following in your error log

2025/08/05 21:05:10 [notice] 19#19: signal process started
2025/08/05 21:05:10 [notice] 8#8: signal 1 (SIGHUP) received from 19, reconfiguring
2025/08/05 21:05:10 [notice] 8#8: reconfiguring

Instead of running nginx -s reload, you could also try reloading the service altogether. If that doesn’t work either, I would really need a reproducible environment to offer further help. You can probably use some public endpoints for your proxy target and you should be able to use localhost as your NGINX/IPv4 server.

I found the solution!

server1.wizards-tower.ipv64.de

points to my internal network. There is another nginx running to route the traffic from serveral wizards-tower.ipv64.de subdomains to my internal server and docker container.
So I had the idea that the welcome page is delivered from my internal nginx…
In the browser I enter
http://server1.duckdns.org/
And this URL is forwarded to my internal nginx… And it didn’t know this domain…

I’ve changed the config of my internal nginx so that it listens to both domains

But after a restart the behaviour was the same

Than I saw that there was a default config in sites-enabled. After deleting this symlink it worked.

What I need to test:
I have several services which should be accessable via IPv4, so I will create more domains. Then I will change my internal ngix and add the additional doamins. Hope this works, too.

Thanks a lot for your help!
And sorry that I’ve forgotten to mention the second nginx. It just didn’t come to my mind that this could be an issue :frowning:

The second NGINX instance would indeed explain the behaviour! You should be able to add additional domains to your NGINX config without any further issues by following a similar pattern :slightly_smiling_face:

1 Like

Will try do do it this way…
Tricky that there was no hint that the second nginx delivered the welcome page :stuck_out_tongue:

1 Like

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