app.yml 파일 업데이트 관련 문제

./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

“after_code:” 다음에 app.yml 파일에 다음 내용을 추가했습니다:

 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"

목표는 301 리다이렉트를 사용하여 구 도메인을 새 도메인으로 연결하고, LetsEncrypt를 통해 구 도메인의 갱신을 계속하는 것입니다. 수정된 .yml 파일은 “구 도메인” 서버에 있습니다.

"old-domain.com"과 "new-domain.com"은 실제 웹 주소가 아닌 플레이스홀더입니다.

여기와 여기에서 제안된 방법대로 진행했습니다.

네. YAML 오류입니다. 파일의 어디에든 있을 수 있습니다. 인터넷에는 다양한 YAML 검사 도구가 있습니다. 하나의 해결책은 파일 전체를 그중 하나에 붙여넣는 것입니다.