# Discourse-app container start dan stopt stilzwijgend

**URL:** https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [13 september 2022 om 07:58 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859 "2022-09-13T07:58:45Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [16 september 2022 om 08:06 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/21 "2022-09-16T08:06:48Z")

</div>

Right! I’ve dumbly applied the config in the page listed above, compared to other nginx config files and couldn’t understand why the proxy wouldn’t listen to 80:443 for discourse… 😕

Here’s what I expected to see:

```plaintext
server {
	listen 80;
	server_name discourse.mydomain.com;
    return 301 https://$host$request_uri; # routing to https
}

server {
	listen 443 ssl
	listen [::]:443 ssl;
	server_name discourse.mydomain.com;

	ssl_certificate /etc/letsencrypt/live/discourse.mydomain.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/discourse.mydomain.com/privkey.pem;

	root /var/www/html;

	# Add index.php to the list if you are using PHP
	index index.html index.htm index.nginx-debian.html;

	location / {
      proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:; # using socket
      proxy_set_header Host $http_host;
      proxy_http_version 1.1;
      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;
	}
}

```

NPM: I’ve followed @pfaffman’s advide and read [Use Nginx Proxy Manager to manage multiple sites with Discourse](https://meta.discourse.org/t/using-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344), so I’ve evaluated the option to install NPM, but this looks overkill…

Thanks to all for your help!

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [16 september 2022 om 09:38 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/22 "2022-09-16T09:38:35Z")

</div>

For reference [npm](https://www.npmjs.com/), and the [nginx proxy manager](https://nginxproxymanager.com/) are different things. You’re confusing your terminology, and thus the people trying to assist you.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [16 september 2022 om 10:33 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/23 "2022-09-16T10:33:05Z")

</div>

> [@jlgarnier](#):
>
> Opening a browser to [discourse.mydomain.com](http://discourse.mydomain.com) leads me to… the Nextcloud instance running on the server

Then you need to configure that nginx to proxy to discourse.

I recommend that you just spin up a fresh vm just for Discourse.

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [16 september 2022 om 12:36 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/24 "2022-09-16T12:36:50Z")

</div>

Sorry Stephen for the confusion, I just used the name of the tool which is referenced in the article. I understand that NPM and nginx (as a) proxy manager are different things, this is why I used capital letters…

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [16 september 2022 om 12:46 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/25 "2022-09-16T12:46:42Z")

</div>

> [@pfaffman](#):
>
> Then you need to configure that nginx to proxy to discourse.

This is exactly what I’m trying to do and I understand you cannot support on this. However, any hint / link would be appreciated!

> [@pfaffman](#):
>
> I recommend that you just spin up a fresh vm just for Discourse.

I just can’t Jay: I’m trying to help a friend deploying the app and can’t modify their server configuration. This is why I have to fix the nginx issue…

By the way, my understanding is:

- Discourse is listening on ports 80/443.
- nginx is playing the role of a switch, dispatching requests to different applications, base on their domain name:
  - [netxcloud.mydomain.com](http://netxcloud.mydomain.com) trying to reach the port 80 → request is routed to server\_IP:8000
  - [crm.mydomain.com](http://crm.mydomain.com) trying to reach the port 80 → request is routed to server\_IP:9000
  - [discourse.mydomain.com](http://discourse.mydomain.com) trying to reach the port 80 → request is routed to `http://unix:/var/discourse/shared/standalone/nginx.http.sock:` (hope the trailing colon is not a typo) as the setupo script has configured discourse to listen to this socket.

Am I right on this?

Thanks a lot for your help!

---

<div class="post-metadata">

### Author: ![khenmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/khenmu/32/108976_2.png) [@khenmu](https://meta.discourse.org/u/khenmu)
#### Post date: [16 september 2022 om 12:55 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/26 "2022-09-16T12:55:59Z")

</div>

That is rather annoying and confusing, but to be fair to @jlgarnier, that acronym was first used by either @tophee or @pfaffman in [Using Nginx Proxy Manager to manage multiple sites with Discourse](https://meta.discourse.org/t/using-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344) to refer to Nginx Proxy Manager. I don’t love it, but if it is ‘wrong’, that isn’t really OP’s fault.

For example, the topic has a section called `Install NPM` focusing entirely on Nginx Proxy Manager.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [16 september 2022 om 13:21 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/27 "2022-09-16T13:21:59Z")

</div>

Wow, that fooled me as well.  
Annoying how that project hijacked an existing acronym eight years after the original.

---

<div class="post-metadata">

### Author: ![khenmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/khenmu/32/108976_2.png) [@khenmu](https://meta.discourse.org/u/khenmu)
#### Post date: [16 september 2022 om 13:54 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/28 "2022-09-16T13:54:19Z")

</div>

I’m not sure that it has; I’ve browsed their site & not seen them use the acronym themselves.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [16 september 2022 om 14:36 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/29 "2022-09-16T14:36:18Z")

</div>

They do use it in their Docker setups. [nginx-proxy-manager/docker/docker-compose.dev.yml at develop · NginxProxyManager/nginx-proxy-manager · GitHub](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/docker-compose.dev.yml)

```plaintext
services:
  npm:
    image: nginxproxymanager:dev
    container_name: npm_core

```

---

<div class="post-metadata">

### Author: ![khenmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/khenmu/32/108976_2.png) [@khenmu](https://meta.discourse.org/u/khenmu)
#### Post date: [16 september 2022 om 14:40 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/30 "2022-09-16T14:40:24Z")

</div>

Ah, oops! I hadn’t realised that. 🙂

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [19 september 2022 om 12:43 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/31 "2022-09-19T12:43:42Z")

</div>

Hi all,

I’ll try to setup nginx again this afternoon. Can anyone confirm the exact syntax for the socket: `http://unix:/var/discourse/shared/standalone/nginx.http.sock:`? I want to make sure that the trailing colon is not a typo…

Thanks in advance for any help!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [19 september 2022 om 13:06 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/32 "2022-09-19T13:06:15Z")

</div>

I don’t think that colon should be there, no.

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [19 september 2022 om 13:46 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/33 "2022-09-19T13:46:11Z")

</div>

Indeed… I’ve applied in discourse.conf the modifications I proposed last Friday and Discourse now runs fine! At least I can reach the welcome page but I don’t receive the activation mail, which is not related to Discourse (I suspect my friend didn’t create the requested mail account 😊).

I owe you a warm thank you for the help you provided and hope I won’t come back on this forum too soon! 😉

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [20 september 2022 om 11:53 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/34 "2022-09-20T11:53:54Z")

</div>

Finally, back sooner than expected but you’ll probably be able to kick me off with your great suggestions! 😁

The situation is:

- Discourse up and running, Docker (or Portainer) indicates the container is healthy and I can reach the welcome page [forums.mydomain.com](http://forums.mydomain.com).
- I don’t receive any activation mail, despite the technical mail account has been properly created (hosting provider = OVH).
- I’ve tested sending an email from this technical account (with the config below) = OK.
- The current mail config is:

```plaintext
DISCOURSE_SMTP_ADDRESS: ssl0.ovh.net
DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_USER_NAME: forums@mydomain.com
DISCOURSE_SMTP_PASSWORD: "Str0ngPassw0rd"
DISCOURSE_SMTP_ENABLE_START_TLS: false
DISCOURSE_SMTP_DOMAIN: mydomain.com
DISCOURSE_NOTIFICATION_EMAIL: noreply-forums@mydomain.com

```

I don’t really know where I should start investigating and would be happy with any advice!

Thanks in advance for your help!

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [20 september 2022 om 11:56 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/35 "2022-09-20T11:56:31Z")

</div>

> [@jlgarnier](#):
>
> `noreply-forums@mydomain.com`

First thing I’ll check is that if `forums@mydomain.com` has been configured to send on behalf of `noreply-forums@mydomain.com` it needs to be checked at your email provider.

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [20 september 2022 om 13:33 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/36 "2022-09-20T13:33:09Z")

</div>

I’m not sure this address can send ‘on behalf on’, so I’ve updated app.yml to set the same address:

```plaintext
DISCOURSE_SMTP_ADDRESS: ssl0.ovh.net
DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_USER_NAME: forums@mydomain.com
DISCOURSE_SMTP_PASSWORD: "Str0ngPassw0rd"
DISCOURSE_SMTP_ENABLE_START_TLS: false
DISCOURSE_SMTP_DOMAIN: mydomain.com
DISCOURSE_NOTIFICATION_EMAIL: forums@mydomain.com

```

Tried to `telnet ssl0.ovh.net 465` = OK

However discourse-doctor reports:

```plaintext
========================================
Discourse 2.9.0.beta9
Discourse version at forums.mydomain.com: Discourse 2.9.0.beta9
Discourse version at localhost: NOT FOUND
==================== DNS PROBLEM ====================
This server reports NOT FOUND, but forums.mydomain.com reports Discourse 2.9.0.beta9 .
This suggests that you have a DNS problem or that an intermediate proxy is to blame.

[...]

Testing sending to myprivatemail@yahoo.fr using ssl0.ovh.net:465, username:forums@mydomain.com with plain auth.
======================================== ERROR ========================================
                                    UNEXPECTED ERROR

Net::ReadTimeout

====================================== SOLUTION =======================================

```

Could the mail issue be linked to the alleged DNS issue? I don’t have an “intermediate proxy”, just running nginx as the proxy web server…

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [20 september 2022 om 13:36 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/37 "2022-09-20T13:36:05Z")

</div>

> [@jlgarnier](#):
>
> `DISCOURSE_SMTP_PORT: 465`

This is probably your problem. Can you try a different port? I’ve seen best results with port 587 if that’s supported by your email provider.

> [@jlgarnier](#):
>
> `DISCOURSE_SMTP_ENABLE_START_TLS: false`

You’ll need to comment this out or set it to true if you change port to 587

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [20 september 2022 om 13:44 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/38 "2022-09-20T13:44:12Z")

</div>

No, my email provider (same as hosting provider) only allows port 465. By the way, I’ve read that I need to set SPF and DKIM record for the domain (is this **sub** domain?) and I didn’t set any of these yet: could this have any impact?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [20 september 2022 om 13:46 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/39 "2022-09-20T13:46:27Z")

</div>

See [Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326)

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [20 september 2022 om 14:43 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/40 "2022-09-20T14:43:56Z")

</div>

I’m browsing the post but I’ve forgotten some information:

- The DNS is managed by our hosting provider (for some services), let’s say on ServerA.
- Discourse is running on another server (ServerB) which is hosted by a different provider.

My understanding is then: Discourse on ServerB connects to the mail server on ServerA, authenticating with email/password to use the SMTP service provided by ServerA hosting provider.

Is this a abnormal config or may I still use the normal app.yml email config here?

[Vorige pagina](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859.md?page=1)

[Volgende pagina](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859.md?page=3)
