# Upgrading failing with: The "before-server" Nginx outlet is missing... discourse\_docker is not compatible with the chosen Discourse version

**URL:** https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869
**Category:** Support
**Created:** [July 11, 2025, 11:56am UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869 "2025-07-11T11:56:29Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [July 11, 2025, 11:56am UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/1 "2025-07-11T11:56:29Z")

</div>

I’ve a Discourse server for which `./launcher rebuild app` results in:

```txt
FAILED
--------------------
Pups::ExecError: grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The "before-server" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 ) failed with return #<Process::Status: pid 300 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec failed with the params {"cmd"=>["cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf", "rm /etc/nginx/sites-enabled/default", "mkdir -p /var/nginx/cache", "grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"before-server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "grep -q 'outlets/server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "grep -q 'outlets/discourse' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"discourse\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "mkdir -p /etc/nginx/conf.d/outlets/before-server", "touch /etc/nginx/conf.d/outlets/before-server/20-redirect-http-to-https.conf", "touch /etc/nginx/conf.d/outlets/before-server/30-ratelimited.conf", "mkdir -p /etc/nginx/conf.d/outlets/server", "touch /etc/nginx/conf.d/outlets/server/10-http.conf", "touch /etc/nginx/conf.d/outlets/server/20-https.conf", "touch /etc/nginx/conf.d/outlets/server/30-offline-page.conf", "mkdir -p /etc/nginx/conf.d/outlets/discourse", "touch /etc/nginx/conf.d/outlets/discourse/20-https.conf", "touch /etc/nginx/conf.d/outlets/discourse/30-ratelimited.conf"]}
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
727ce99bf07d8a65ba26b70f4515a2b6dab493ca00f436098de95e70604b6d6b

```

The code is up to date:

```bash
git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

```

I tried running `./discourse-doctor` but that resulted in the same error.

The server is question is running Ubuntu:

```bash
cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.2 LTS"

```

With [the latest Docker](https://github.com/moby/moby/releases/latest):

```txt
apt info docker-ce
Package: docker-ce
Version: 5:28.3.2-1~ubuntu.24.04~noble
Priority: optional
Section: admin
Maintainer: Docker <support@docker.com>
Installed-Size: 90.1 MB
Pre-Depends: init-system-helpers (>= 1.54~)
Depends: containerd.io (>= 1.6.24), docker-ce-cli, iptables, libc6 (>= 2.34), libsystemd0
Recommends: apparmor, ca-certificates, docker-ce-rootless-extras, git, pigz, procps, xz-utils
Suggests: cgroupfs-mount | cgroup-lite, kmod
Conflicts: docker (<< 1.5~), docker-engine, docker.io
Replaces: docker-ce-cli (<< 5:28.0.0), docker-engine
Homepage: https://www.docker.com
Download-Size: 19.6 MB
APT-Manual-Installed: yes
APT-Sources: https://download.docker.com/linux/ubuntu noble/stable amd64 Packages
Description: Docker: the open-source application container engine
 Docker is a product for you to build, ship and run any application as a
 lightweight container
 .
 Docker containers are both hardware-agnostic and platform-agnostic. This means
 they can run anywhere, from your laptop to the largest cloud compute instance and
 everything in between - and they don't require you to use a particular
 language, framework or packaging system. That makes them great building blocks
 for deploying and scaling web apps, databases, and backend services without
 depending on a particular stack or provider.

N: There are 34 additional records. Please use the '-a' switch to see them.

```

Does anyone have any suggestions? Do I need to manually edit the Nginx config in the running container to get around this or something?

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [July 11, 2025, 12:45pm UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/2 "2025-07-11T12:45:08Z")

</div>

I have tried downgrading [docker\_manager](https://github.com/discourse/docker_manager/) code base to the [version](https://github.com/discourse/docker_manager/commits/main/) before [the last commit on Jul 10, 2025](https://github.com/discourse/docker_manager/commit/5d90bc7f8b376220460f5e97ac80be7f43963240):

```bash
su - discourse
cd /var/discourse/
./launcher enter app
su - discourse
cd /var/www/discourse/plugins/docker_manager
git checkout d91016c
exit
exit
./launcher rebuild app

```

But that didn’t make a difference.

---

<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: [July 11, 2025, 2:13pm UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/3 "2025-07-11T14:13:44Z")

</div>

I just did a rebuild without any trouble. Are there other errors above what you included?

What does `free -h` report?

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [July 11, 2025, 2:37pm UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/4 "2025-07-11T14:37:02Z")

</div>

It’s not a disk space issue:

```bash
df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 588M 1.1M 587M 1% /run
/dev/sda2 118G 79G 34G 71% /
tmpfs 2.9G 0 2.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 588M 12K 588M 1% /run/user/1001

```

The server doesn’t have any swap but it has 6 GB RAM:

```bash
free -h
               total used free shared buff/cache available
Mem: 5.7Gi 793Mi 1.2Gi 1.0Mi 4.1Gi 5.0Gi
Swap: 0B 0B 0B

```

Do you think a swap disk is needed?

There were no other errors but I could post the whole of the `./launcher rebuild app` output if you think that might help?

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [July 11, 2025, 3:34pm UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/5 "2025-07-11T15:34:40Z")

</div>

Following is what the Nginx config (`/etc/nginx/conf.d/discourse.conf`) in the container contains, there was no reference to `outlets/before-server`:

```nginx
# Additional MIME types that you'd like nginx to handle go in here
types {
    text/csv csv;
}

upstream discourse { server 127.0.0.1:3000; }

proxy_cache_path /var/nginx/cache keys_zone=one:10m max_size=200m;

# see: https://meta.discourse.org/t/x/74060
proxy_buffer_size 8k;

# If you are going to use Puma, use these:
#
# upstream discourse {
# server unix:/var/www/discourse/tmp/sockets/puma.sock;
# }

# attempt to preserve the proto, must be in http context
map $http_x_forwarded_proto $thescheme {
  default $scheme;
  https https;
}

log_format log_discourse '[$time_local] "$http_host" $remote_addr "$request" "$http_user_agent" "$sent_http_x_discourse_route" $status $bytes_sent "$http_referer" $upstream_response_time $request_time "$sent_http_x_discourse_username"';

limit_req_zone $binary_remote_addr zone=flood:10m rate=12r/s;
limit_req_zone $binary_remote_addr zone=bot:10m rate=200r/m;
limit_req_status 429;
limit_conn_zone $binary_remote_addr zone=connperip:10m;
limit_conn_status 429;
server {
  listen 80;
  return 301 https://discourse.example.org$request_uri;
}
server {

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

  listen 443 ssl;
http2 on;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;

ssl_certificate /shared/ssl/discourse.example.org.cer;
ssl_certificate /shared/ssl/discourse.example.org_ecc.cer;

ssl_certificate_key /shared/ssl/discourse.example.org.key;
      proxy_ignore_headers "Set-Cookie";
      proxy_hide_header "Set-Cookie";

      proxy_cache one;
      proxy_cache_key $uri;
      proxy_cache_valid 200 7d;
      proxy_cache_valid 404 1m;
      proxy_set_header Connection "";

      proxy_pass https://avatars.discourse.org/;
      break;
    }

    # we need buffering off for message bus
    location /message-bus/ {
      proxy_set_header X-Request-Start "t=${msec}";
      proxy_set_header Host $http_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 $thescheme;
      proxy_http_version 1.1;
      proxy_buffering off;
      proxy_pass http://discourse;
      break;
    }

    # this means every file in public is tried first
    try_files $uri @discourse;
  }

  location /downloads/ {
    internal;
    alias $public/;
  }

  location @discourse {
add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain

  limit_conn connperip 20;
  limit_req zone=flood burst=12 nodelay;
  limit_req zone=bot burst=100 nodelay;
    add_header Referrer-Policy 'no-referrer-when-downgrade';
    proxy_set_header Host $http_host;
    proxy_set_header X-Request-Start "t=${msec}";
    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 $thescheme;
    proxy_pass http://discourse;
  }

}

```

So I installed `vim` and `dos2unix` and edited the files to add [the line](https://github.com/discourse/discourse/blob/301f27caaa7c623dba7c3e30b416e9bd6af560f7/config/nginx.sample.conf#L41):

```nginx
include conf.d/outlets/before-server/*.conf;

```

And I stopped and started Nginx and then exited the container and ran `./launcher rebuild app` again but the same error was returned:

```plaintext

FAILED
--------------------
Pups::ExecError: grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The "before-server" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 ) failed with return #<Process::Status: pid 300 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131:in `spawn'
exec failed with the params {"cmd"=>["cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf", "rm /etc/nginx/sites-enabled/default", "mkdir -p /var/nginx/cache", "grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"before-server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "grep -q 'outlets/server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "grep -q 'outlets/discourse' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"discourse\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "mkdir -p /etc/nginx/conf.d/outlets/before-server", "touch /etc/nginx/conf.d/outlets/before-server/20-redirect-http-to-https.conf", "touch /etc/nginx/conf.d/outlets/before-server/30-ratelimited.conf", "mkdir -p /etc/nginx/conf.d/outlets/server", "touch /etc/nginx/conf.d/outlets/server/10-http.conf", "touch /etc/nginx/conf.d/outlets/server/20-https.conf", "touch /etc/nginx/conf.d/outlets/server/30-offline-page.conf", "mkdir -p /etc/nginx/conf.d/outlets/discourse", "touch /etc/nginx/conf.d/outlets/discourse/20-https.conf", "touch /etc/nginx/conf.d/outlets/discourse/30-ratelimited.conf"]}
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
b18ed0cbde3a34dfe76ea066657ece16c5a063ff18627d4a7e4b9787268917c0

```

So I restarted the container (`./launcher start app`) to check it:

```bash
grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf 
echo $?
0

```

So I don’t understand why it is failing when the Nginx include is present?

There are a lot of differences between `/var/www/discourse/config/nginx.sample.conf` and `/etc/nginx/conf.d/discourse.conf` — should I try replacing the file with the sample and editing it to update the domain name?

## Update

Earlier the Discourse web interface wouldn’t allow updates, it said updates must be done using the CLI, however now it does allow them (why is that?) so I have updated `discourse_docker` using the Web UI:

 ![Screenshot 2025-07-11 at 16-41-43 Admin - Sands Online Community TESTING SERVER](https://global.discourse-cdn.com/meta/original/4X/a/b/8/ab831eb5c4f77d869d7e6e6b27aab9545ebe3b3f.png)

And also `discourse`:

 ![Screenshot 2025-07-11 at 16-51-40 Admin - Sands Online Community TESTING SERVER](https://global.discourse-cdn.com/meta/original/4X/a/b/8/ab8f96913e66cc75b70ba2394bf31fc0177fade9.png)

 ![Screenshot 2025-07-11 at 16-52-17 Dashboard - Admin - Sands Online Community TESTING SERVER](https://global.discourse-cdn.com/meta/original/4X/b/4/f/b4ff9c07691f3d16f8fac28d741d0ae38b0ad6c6.png)

So this issue is resolved _however_ what, if anything, I did to solve it is a mystery… 🤷‍♀️

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [July 12, 2025, 8:56am UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/6 "2025-07-12T08:56:04Z")

</div>

I’ve tracked down the issue — it was caused by the [discourse-images-guardian](https://meta.discourse.org/t/disallow-anonymous-users-from-viewing-image-file-urls/40335/20) plugin from @mbcahyono which needed the `nginx.sample.conf` file updating, I have done this and created a [pull request](https://github.com/muhlisbc/discourse-images-guardian/pull/5) to fix it.

---

<div class="post-metadata">

### Author: ![mbcahyono](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbcahyono/32/97721_2.png) [@mbcahyono](https://meta.discourse.org/u/mbcahyono)
#### Post date: [July 12, 2025, 9:21am UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/7 "2025-07-12T09:21:19Z")

</div>

Merged! Thanks for the PR.

I didn’t get a chance to test it, so I’m trusting you on this one 🙂

---

<div class="post-metadata">

### Author: ![chrisc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisc/32/119982_2.png) [@chrisc](https://meta.discourse.org/u/chrisc)
#### Post date: [July 12, 2025, 9:27am UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/8 "2025-07-12T09:27:24Z")

</div>

Thanks @mbcahyono I did some basic testing and it seems to work…! However this is [this issue](https://github.com/muhlisbc/discourse-images-guardian/issues/6) — overriding the site image URLs doesn’t work any more, any ideas how to fix this?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 11, 2025, 9:28am UTC](https://meta.discourse.org/t/upgrading-failing-with-the-before-server-nginx-outlet-is-missing-discourse-docker-is-not-compatible-with-the-chosen-discourse-version/373869/9 "2025-08-11T09:28:14Z")

</div>

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