You can add stuff to your app.yml to modify the nginx config (or run an external one). I’m not sure where best to send you. Here’s an example of making some changes to the nginx config for another purpose:
after_ssl:
# do not redirect all hosts back to the main domain name
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /if \(\$http_host[^\}]*\}/m
to: ""
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /return 301.*$/
to: "return 301 https://$host$request_uri;"