# I am unable to start Ghost and its preventing NGINX from also starting due to a .well-known directory issue. How do I fix it?

**URL:** <https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420>\
**Category:** Self-hosting\
**Created:** [September 23, 2023, 11:26am UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420 "2023-09-23T11:26:06Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![j-telford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/j-telford/32/26495_2.png) [@j-telford](https://forum.ghost.org/u/j-telford)\
**Post date:** [September 23, 2023, 11:26am UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/1 "2023-09-23T11:26:06Z")

</div>

Hi there,

I have been running my website powered by Ghost successfully for several months now. Last night I updated my server, and then updated Ghost. Since the update, I am unable to start Ghost, and it is preventing me from even starting NGINX.

Here are my Ghost and System Details

_ **Domain = mythbound.online** _

**GHOST:**

Ghost-CLI version: 1.24.2  
Ghost version: 5.65.0 (at /var/www/mythbound/website/ghost)

**SYSTEM:**

OS: Ubuntu 22.04.3 LTS  
Kernel: 5.15.0-84-generic  
Node: v18.17.1  
NPM: 9.6.7  
NGINX: nginx/1.18.0 (Ubuntu)

Running `ghost doctor` gives the following:

```auto

✔ Checking system Node.js version - found v18.17.1
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
System checks failed with message: 'Missing package(s): nginx'
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using `ghost install local` instead.
? Continue anyway? Yes
System stack check skipped
ℹ Checking system compatibility [skipped]
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_mythbound-online
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v18.17.1

```

That is to be expected as I cannot start NGINX, but at least you can see that all the perms are set correctly, and that Ghost is finding the right Node version.

When I test NGINX config the tests pass perfectly fine, as showing here:

```auto

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

```

When I look at the NGINC logs, I see that these errors occurred while trying to start NGIX.

```auto
2023/09/22 00:23:21 [error] 582065#582065: *142949 open() "/var/www/mythbound/website/ghost/system/nginx-root/.well-known/acme-challenge/6s-F8N9doZMrknm_58YhxG5GPIORbgjyTU8soZAJEWI" failed (2: No such file or directory), client: 18.222.24.83, server: mythbound.online, request: "GET /.well-known/acme-challenge/6s-F8N9doZMrknm_58YhxG5GPIORbgjyTU8soZAJEWI HTTP/1.1", host: "mythbound.online"
2023/09/22 00:23:21 [error] 582065#582065: *142950 open() "/var/www/mythbound/website/ghost/system/nginx-root/.well-known/acme-challenge/6s-F8N9doZMrknm_58YhxG5GPIORbgjyTU8soZAJEWI" failed (2: No such file or directory), client: 23.178.112.200, server: mythbound.online, request: "GET /.well-known/acme-challenge/6s-F8N9doZMrknm_58YhxG5GPIORbgjyTU8soZAJEWI HTTP/1.1", host: "mythbound.online"
2023/09/22 00:23:21 [error] 582065#582065: *142951 open() "/var/www/mythbound/website/ghost/system/nginx-root/.well-known/acme-challenge/6s-F8N9doZMrknm_58YhxG5GPIORbgjyTU8soZAJEWI" failed (2: No such file or directory), client: 35.88.153.50, server: mythbound.online, request: "GET /.well-known/acme-challenge/6s-F8N9doZMrknm_58YhxG5GPIORbgjyTU8soZAJEWI HTTP/1.1", host: "mythbound.online"

```

The issue seems to be that the `.well-known` directory does not exist, and NGINX is trying to look there for SSL certificates.

Here is my NGINX server block for my ghost powered website:

```auto

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name mythbound.online;
    root /var/www/mythbound/website/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

    ssl_certificate /etc/letsencrypt/mythbound.online/fullchain.cer;
    ssl_certificate_key /etc/letsencrypt/mythbound.online/mythbound.online.key;
    include /etc/nginx/snippets/ssl-params.conf;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2368;

    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 1g;
}

```

I do not know how to fix this, can any of you help me? If I just remove this part of the server block:

```auto

    }

    location ~ /.well-known {
        allow all;
    }

```

Will that fix the problem?

Is there a better way to fix this issue?

Everything was working fine until last night when I updated the server and then updated Ghost.

Thanks

Jay

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 23, 2023, 12:04pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/2 "2023-09-23T12:04:56Z")

</div>

Welcome to the Ghost community, @j-telford.

Please share the output from `which nginx`.

---

<div class="post-metadata">

**Author:** ![j-telford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/j-telford/32/26495_2.png) [@j-telford](https://forum.ghost.org/u/j-telford)\
**Post date:** [September 23, 2023, 12:06pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/3 "2023-09-23T12:06:29Z")

</div>

Hi, here is the response you asked for. Running `which nginx` gives me:

```auto

/usr/sbin/nginx

```

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 23, 2023, 12:27pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/4 "2023-09-23T12:27:26Z")

</div>

Okay, check that Nginx is running with `sudo systemctl status nginx` (note that `nginx -t` works when the server isn’t running.)

---

<div class="post-metadata">

**Author:** ![j-telford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/j-telford/32/26495_2.png) [@j-telford](https://forum.ghost.org/u/j-telford)\
**Post date:** [September 23, 2023, 12:37pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/5 "2023-09-23T12:37:47Z")

</div>

Doing so, shows me that NGINX is not running:

```auto

× nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-09-23 10:56:35 UTC; 1h 36min ago
       Docs: man:nginx(8)
    Process: 11084 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 11085 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
        CPU: 143ms

Sep 23 10:56:33 zod.jaytelford.me systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 23 10:56:33 zod.jaytelford.me nginx[11085]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Sep 23 10:56:33 zod.jaytelford.me nginx[11085]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Sep 23 10:56:34 zod.jaytelford.me nginx[11085]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Sep 23 10:56:34 zod.jaytelford.me nginx[11085]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Sep 23 10:56:35 zod.jaytelford.me nginx[11085]: nginx: [emerg] bind() to [::]:80 failed (98: Unknown error)
Sep 23 10:56:35 zod.jaytelford.me nginx[11085]: nginx: [emerg] still could not bind()
Sep 23 10:56:35 zod.jaytelford.me systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Sep 23 10:56:35 zod.jaytelford.me systemd[1]: nginx.service: Failed with result 'exit-code'.
Sep 23 10:56:35 zod.jaytelford.me systemd[1]: Failed to start A high performance web server and a reverse proxy server.

```

Attempting to start it gives me the error:

```auto

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.

```

The journal shows:

```auto

░░ Subject: A start job for unit nginx.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit nginx.service has finished with a failure.
░░
░░ The job identifier is 5084 and the job result is failed.

```

It is really confusing me because everything was working till I ran the server update and updated ghost last night. Other than that, no files have been changed and the server block is exactly the same as it was before it stopped working.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 23, 2023, 1:26pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/6 "2023-09-23T13:26:22Z")

</div>

> [@j-telford](#):
>
> NGINX is not running

That was my suspicion. It looks like you have another web server or server listening on port 80.

---

<div class="post-metadata">

**Author:** ![j-telford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/j-telford/32/26495_2.png) [@j-telford](https://forum.ghost.org/u/j-telford)\
**Post date:** [September 23, 2023, 1:59pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/7 "2023-09-23T13:59:13Z")

</div>

I am really confused by that, because I should not have anything else listening on port 80. I looked at all the listening ports that are currently in use on my server, and this is what I got.

```auto

sudo sudo netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 979/sshd: /usr/sbin
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 884/systemd-resolve
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1032/mysqld
tcp 0 0 127.0.0.1:2368 0.0.0.0:* LISTEN 1139/node
tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 1032/mysqld
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 923/redis-server 12
tcp6 0 0 :::22 :::* LISTEN 979/sshd: /usr/sbin
tcp6 0 0 ::1:6379 :::* LISTEN 923/redis-server 12
udp 0 0 redacted:53 0.0.0.0:* 884/systemd-resolve
udp 0 0 redacted:68 0.0.0.0:* 882/systemd-network
udp6 0 0 redacted:546 :::* 882/systemd-network

```

As you can see, there is nothing currently using port 80. So I am not sure what is going on then.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 23, 2023, 2:06pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/8 "2023-09-23T14:06:57Z")

</div>

This is strange. I have read that this can occur if Nginx is attempting to bind to port 80 more than once, or you’re trying to listen on `[::]:80` when IPV6 isn’t configured. Do you still have the default server in your Nginx config? If so, remove this from `sites-enabled`.

---

<div class="post-metadata">

**Author:** ![j-telford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/j-telford/32/26495_2.png) [@j-telford](https://forum.ghost.org/u/j-telford)\
**Post date:** [September 23, 2023, 2:27pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/9 "2023-09-23T14:27:02Z")

</div>

Still no joy I’m afraid. I moved the default server block out of both sites-enabled (still would not start) so i moved it out of sites-available, and the server still would not start. At this point, I am wondering if I should just uninstall Ghost, move all my other server blocks out of the sites-available dir, purge nginx and start from scratch.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 23, 2023, 2:40pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/10 "2023-09-23T14:40:21Z")

</div>

I don’t think the issue is related to Ghost; Ghost can’t start because of the Nginx failed state. Instead, try removing all symbolic links from `sites-enabled` and then add your Ghost site first, followed by the others one at a time.

Use …

```auto
nginx -t
systemctl reload nginx

```

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [September 23, 2023, 3:34pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/11 "2023-09-23T15:34:09Z")

</div>

I believe the problem is related to renewing the SSL certificate for the domain, because it ties together everything here:

1. Certs are renewed every few months, explaining why something can appear to “suddenly stop working”.
2. The “.well-known” directory is used during the renewal process.
3. One method of renewal involves stopping Nginx just briefly, starting an alternate web server on port 80, renewing the certificate, then stopping that and starting Nginx again. Sounds like this process got stuck.

Honestly, I recommend rebooting the server. I presume that Nginx is set to start on boot and the certbot server is not, so if my theory holds, it will reset that state.

Then run:

```auto
sudo certbot renew

```

To manually kick-off the renewal process and see if it succeeds or fails.

Good luck!

---

<div class="post-metadata">

**Author:** ![j-telford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/j-telford/32/26495_2.png) [@j-telford](https://forum.ghost.org/u/j-telford)\
**Post date:** [September 23, 2023, 6:07pm UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/12 "2023-09-23T18:07:03Z")

</div>

I removed everything and started to add them back one at a time. Testing and then restarting with each one.

I’ve found the culprit.

I had set up a custom redirect, from a subdomain to a discord invite link using NGINX.

It was this redirect that was the problem.

I removed the redirect and everything works again.

Thanks everyone.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [January 1, 2024, 10:32am UTC](https://forum.ghost.org/t/i-am-unable-to-start-ghost-and-its-preventing-nginx-from-also-starting-due-to-a-well-known-directory-issue-how-do-i-fix-it/41420/13 "2024-01-01T10:32:06Z")

</div>

2 posts were split to a new topic: [Welcome to Nginx message](https://forum.ghost.org/t/welcome-to-nginx-message/43739)
