# Falha ao atualizar com: Falta a saída Nginx "before-server"... discourse\_docker não é compatível com a versão escolhida do Discourse

**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:** Product Support\
**Created:** [Julho 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:** 1\
**Showing post:** 5

<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:** [Julho 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>

A seguir está a configuração do Nginx (`/etc/nginx/conf.d/discourse.conf`) no contêiner, não havia referência a `outlets/before-server`:

```nginx
# Tipos MIME adicionais que você gostaria que o nginx tratasse vão aqui
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;

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

# Se você for usar o Puma, use estes:
#
# upstream discourse {
# server unix:/var/www/discourse/tmp/sockets/puma.sock;
# }

# tenta preservar o proto, deve estar no contexto http
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;
    }

    # precisamos desativar o buffering para 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;
    }

    # isso significa que cada arquivo em public é tentado primeiro
    try_files $uri @discourse;
  }

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

  location @discourse {
add_header Strict-Transport-Security 'max-age=31536000'; # lembre-se do certificado por um ano e conecte-se automaticamente ao HTTPS para este domínio

  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;
  }

}

```

Então instalei `vim` e `dos2unix` e editei os arquivos para adicionar [a linha](https://github.com/discourse/discourse/blob/301f27caaa7c623dba7c3e30b416e9bd6af560f7/config/nginx.sample.conf#L41):

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

```

E parei e iniciei o Nginx e então saí do contêiner e executei `./launcher rebuild app` novamente, mas o mesmo erro foi retornado:

```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

```

Então reiniciei o contêiner (`./launcher start app`) para verificar:

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

```

Então não entendo por que está falhando quando o include do Nginx está presente?

Há muitas diferenças entre `/var/www/discourse/config/nginx.sample.conf` e `/etc/nginx/conf.d/discourse.conf` — devo tentar substituir o arquivo pelo sample e editá-lo para atualizar o nome do domínio?

## Atualização

Anteriormente, a interface web do Discourse não permitia atualizações, dizia que as atualizações deveriam ser feitas usando a CLI, no entanto, agora permite (por quê?) então atualizei `discourse_docker` usando a interface Web:

 ![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)

E também `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)

Portanto, este problema está resolvido _no entanto_, o que, se alguma coisa, fiz para resolvê-lo é um mistério… 🤷‍♀️

---

_[View the full topic](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)._
