Probleem met update van app.yml bestand

AI-generated summary

Idan reports a YAML syntax error when running ./launcher rebuild app, occurring at line 10 column 1 in the app.yml file after adding configuration for domain redirection and Let’s Encrypt. The changes include redirecting old-domain.com to new-domain.com via Nginx and updating the Let’s Encrypt renewal command to include both domains. Idan notes the edits were made on the server using the old domain, referencing solutions from the Discourse meta. pfaffman confirms it’s a YAML syntax issue and suggests using an online YAML validator to pinpoint the error.

I get an error after running ./launcher rebuild app:

Did not find expected key while parsing block mapping at line 10 column 1 -e LANG-en_US.UTF8. 

YAML syntax error

I add this to the app.yml file after “after_code:” :

 after_web_config:
    - replace:
        filename: /etc/nginx/nginx.conf
        from: /sendfile.+on;/
        to: |
          server_names_hash_bucket_size 64;
          sendfile on;
    - file:
        path: /etc/nginx/conf.d/discourse_redirect_1.conf
        contents: |
          server {
            listen 80;
            server_name old-domain.com;
            return 301 $scheme://new-domain.com$request_uri;
          }

after_ssl:
    - replace:
        filename: "/etc/runit/1.d/letsencrypt"
        from: /--keylength/
        to: "-d old-domain.com -d new-domain.com --keylength"

The goal to redirect 301 old domain to new domain and with LetsEncrypt continue renewing for the old domain. The .yml file edited is on the “old domain” server.

“old-domain.com” and “new-domain.com” are placeholders not the real web address.

as suggested here and here.

Yes. It’s a yaml error. It could be most anywhere in the file. There are various yaml checkers on the internet. One solution is to paste the whole file into one of those.