404 error. Any idea why?

when running this command 404 error appears, any idea how to resolve? command works fine for other domains on server.

curl -ikL http://webmail.digitalart.hr/.well-known/acme-challenge/test

HTTP/1.1 404 Not Found
Server: nginx
Date: Sun, 29 Sep 2024 11:46:18 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2966
Connection: keep-alive
Vary: Accept-Encoding
ETag: "65d2f7b4-b96"

<!DOCTYPE html>
<html lang="en">
        <head>
                <meta charset="utf-8" />
                <meta name="viewport" content="width=device-width, initial-scale=1" />
                <title>Page Not Found</title>
                <style>
                        body {
                                background-color: #f5f5f5;
                                margin-top: 8%;
                                color: #5d5d5d;
                                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
                                        "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
                                        "Noto Color Emoji";
                                text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.75);
                                text-align: center;
                        }

                        h1 {
                                font-size: 2.45em;
                                font-weight: 700;
                                color: #5d5d5d;
                                letter-spacing: -0.02em;
                                margin-bottom: 30px;
                                margin-top: 30px;
                        }

                        .container {
                                width: 100%;
                                margin-right: auto;
                                margin-left: auto;
                        }

                        .animate__animated {
                                animation-duration: 1s;
                                animation-fill-mode: both;
                        }

                        .animate__fadeIn {
                                animation-name: fadeIn;
                        }

                        .info {
                                color: #5594cf;
                                fill: #5594cf;
                        }

                        .error {
                                color: #c92127;
                                fill: #c92127;
                        }

                        .warning {
                                color: #ffcc33;
                                fill: #ffcc33;
                        }

                        .success {
                                color: #5aba47;
                                fill: #5aba47;
                        }

                        .icon-large {
                                height: 132px;
                                width: 132px;
                        }

                        .description-text {
                                color: #707070;
                                letter-spacing: -0.01em;
                                font-size: 1.25em;
                                line-height: 20px;
                        }

                        .footer {
                                margin-top: 40px;
                                font-size: 0.7em;
                        }

                        .animate__delay-1s {
                                animation-delay: 1s;
                        }

                        @keyframes fadeIn {
                                from {
                                        opacity: 0;
                                }
                                to {
                                        opacity: 1;
                                }
                        }
                </style>
        </head>
        <body>
                <div class="container">
                        <div class="row">
                                <div class="col">
                                        <div class="animate__animated animate__fadeIn">
                                                <svg
                                                        class="info icon-large fa-question-circle"
                                                        xmlns="http://www.w3.org/2000/svg"
                                                        viewBox="0 0 512 512"
                                                >
                                                        <path
                                                                d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"
                                                        ></path>
                                                </svg>
                                        </div>
                                        <h1 class="animate__animated animate__fadeIn">Page Not Found</h1>
                                        <div class="description-text animate__animated animate__fadeIn animate__delay-1s">
                                                <p>Oops! We couldn't find the page that you're looking for.</p>
                                                <p>Please check the address and try again.</p>
                                                <section class="footer"><strong>Error Code:</strong> 404</section>
                                        </div>
                                </div>
                        </div>
                </div>
        </body>
</html>

But are you trying to add manually a subdomain webmail.digitalart.hr or are you trying to get a certificate for the mail domain digitalart.hr?

I’m asking because if the case is the first one, you should show the nginx conf from here:

cat /home/*/conf/web/webmail.digitalart.hr/nginx.conf

If it is the second case, show this nginx conf:

cat /home/*/conf/mail/digitalart.hr/nginx.conf
 cat /home/*/conf/mail/digitalart.hr/nginx.conf
server {
        listen      135.181.115.231:80;
        server_name webmail.digitalart.hr mail.digitalart.hr;
        root        /var/lib/roundcube;
        index       index.php index.html index.htm;
        access_log  /var/log/nginx/domains/webmail.digitalart.hr.log combined;
        error_log   /var/log/nginx/domains/webmail.digitalart.hr.error.log error;

        include /home/digitalart/conf/mail/digitalart.hr/nginx.forcessl.conf*;

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

        location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
                deny all;
                return 404;
        }

        location / {
                alias /var/lib/roundcube/;

                try_files $uri $uri/ =404;

                proxy_pass http://135.181.115.231:xxxx;

                location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
                        expires 7d;
                        fastcgi_hide_header "Set-Cookie";
                }
        }

        location @fallback {
                proxy_pass http://135.181.115.231:xxxx;
        }

        location /error/ {
                alias /var/www/document_errors/;
        }

        include /home/digitalart/conf/mail/digitalart.hr/nginx.conf_*;
}

both webmail and mail give the same response to command
curl -ikL http://webmail.digitalart.hr/.well-known/acme-challenge/test

curl -ikL http://mail.digitalart.hr/.well-known/acme-challenge/test

The nginx conf is the right one:

Show the output of these commands:

grep -r 'webmail.digitalart.hr' /home/*/conf/
cat /home/digitalart/conf/mail/digitalart.hr/nginx.conf_letsencrypt
systemctl restart nginx
nginx -t

grep -r ‘webmail.digitalart.hr’ /home/*/conf/
/home/digitalart/conf/mail/digitalart.hr/nginx.conf: server_name webmail.digitalart.hr mail.digitalart.hr;
/home/digitalart/conf/mail/digitalart.hr/nginx.conf: access_log /var/log/nginx/domains/webmail.digitalart.hr.log combined;
/home/digitalart/conf/mail/digitalart.hr/nginx.conf: error_log /var/log/nginx/domains/webmail.digitalart.hr.error.log error;
/home/digitalart/conf/mail/digitalart.hr/apache2.conf: ServerName webmail.digitalart.hr

cat /home/digitalart/conf/mail/digitalart.hr/nginx.conf_letsencrypt
cat: /home/digitalart/conf/mail/digitalart.hr/nginx.conf_letsencrypt: No such file or directory

systemctl restart nginx

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Mmmm, but did you enable the use of SSL for the mail domain?

imagen

1 Like

Its working now. Thank you for your time and effort! Great work

1 Like

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