Fresh install - nginx config issues

I reimaged my drive and started fresh. All went well. Added my domain back through the panel, went well. Tried to enable ssl using letsencrypt option - nerror nginx failed to restart (but its still running). Here is the error that appears in my nginx log.

2024/06/05 14:22:33 [emerg] 24344#24344: open() "/etc/nginx/conf.d/domains/webmail.mydomain.com.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:129

More details:

root@www:/# sed -n '129p' /etc/nginx/nginx.conf
        include                         /etc/nginx/conf.d/domains/*.conf;

root@www:/# ls -la /etc/nginx/conf.d
total 52
drwxr-xr-x 4 root root 4096 Jun  5 14:21 .
drwxr-xr-x 4 root root 4096 Jun  5 14:25 ..
-rw-r--r-- 1 root root  151 Jun  5 14:21 01_caching_pool.conf
-rw-r--r-- 1 root root 1118 Jun  5 13:50 0rtt-anti-replay.conf
-rw-r--r-- 1 root root  554 Jun  5 13:55 1.myip.conf
-rw-r--r-- 1 root root  671 Jun  5 13:50 agents.conf
-rw-r--r-- 1 root root  805 Jun  5 13:50 cloudflare.inc
drwxr-xr-x 2 root root 4096 Jun  5 14:24 domains
-rw-r--r-- 1 root root   10 Jun  5 13:55 http2-directive.conf
drwxr-xr-x 2 root root 4096 Jun  5 13:50 main
-rw-r--r-- 1 root root  618 Jun  5 13:54 phpmyadmin.inc
-rw-r--r-- 1 root root  354 Jun  5 13:54 phppgadmin.inc
-rw-r--r-- 1 root root  205 Jun  5 13:50 status.conf

root@www:/# systemctl --no-pager -l status nginx.service
● nginx.service - nginx - high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2024-06-05 13:56:23 UTC; 33min ago
       Docs: https://nginx.org/en/docs/
    Process: 776 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
    Process: 17045 ExecReload=/bin/sh -c /bin/kill -s HUP $(/bin/cat /var/run/nginx.pid) (code=exited, status=0/SUCC                                   ESS)
   Main PID: 789 (nginx)
      Tasks: 6 (limit: 9436)
     Memory: 9.2M
        CPU: 168ms
     CGroup: /system.slice/nginx.service
             ├─  789 "nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf"
             ├─17052 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             ├─17053 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             ├─17054 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             ├─17055 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             └─17056 "nginx: cache manager process" "" "" "" "" "" "" "" "" "" "" "" ""

Jun 05 13:56:23 www.mydomain.com systemd[1]: nginx.service: Can't open PID file /run/nginx.pid (yet?) after st                                   art: Operation not permitted
Jun 05 13:56:23 www.mydomain.com systemd[1]: Started nginx - high performance web server.
Jun 05 14:01:11 www.mydomain.com systemd[1]: Reloading nginx - high performance web server...
Jun 05 14:01:11 www.mydomain.com systemd[1]: Reloaded nginx - high performance web server.
Jun 05 14:01:11 www.mydomain.com systemd[1]: Reloading nginx - high performance web server...
Jun 05 14:01:11 www.mydomain.com systemd[1]: Reloaded nginx - high performance web server.
Jun 05 14:01:59 www.mydomain.com systemd[1]: Reloading nginx - high performance web server...
Jun 05 14:01:59 www.mydomain.com systemd[1]: Reloaded nginx - high performance web server.
Jun 05 14:01:59 www.mydomain.com systemd[1]: Reloading nginx - high performance web server...
Jun 05 14:01:59 www.mydomain.com systemd[1]: Reloaded nginx - high performance web server.

both the domain.name and webmail.domain.name have confs in the domains directory. The webmail seems static the domains are symlinks.

What else to check? Or possible fix?

webmail conf files should be symlinks:

webmail.yourdomain.tld.conf -> /home/YourUser/conf/mail/yourdomain.tld/nginx.conf
webmail.yourdomain.tld.ssl.conf -> /home/YourUser/conf/mail/yourdomain.tld/nginx.ssl.conf

I would remove mail domain and would create it again but if you remove it, double check that webmail conf files have been removed too.

1 Like

Sorry that was my mistake, domains are symlinks, webmail are hard links.

both seem to point to correct location.

Hestia doesn’t create hard links so how those hard links are there?

1 Like

Thank you for your help, just removing them and recreating solved it. I would hvaea told you right away but I hit that “new user limit”.

And whoever is in charge of that rule… I get it… but newest users… also need the most help… perhaps instead of a total comment limit, you could make it something more like… total total comments outside of their own support requests… maybe limit them only to 1 or 2 posts but not totally block them when replying to support?

Anyways I am sorted thank you very much.

1 Like

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