Issue with app.yml file update

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.

1 Like

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.

4 Likes

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