"replace" command does not works(discourse-docker)

Hi guys, thank you for check this tipic.
I met an issue when setting nginx header (discourse-docker Env).
The following are dietails:
we are using GitHub - discourse/discourse_docker: A Docker image for Discourse to build our forum. Currently, the security said we need to add header info “Strict-Transport-Security”.

I checked “templates/web.ssl.template.yml” and remove others lines, just leave the follwing lines(whole file content), and I build the container, but the header did not added. Any one met the same issue?

run:
  - replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: "location @discourse {"
     to: |
       location @discourse {
       add_header Strict-Transport-Security 'max-age=31536000'; # remember the certificate for a year and automatically connect to HTTPS for this domain

Thank you again for your patient.