How to configure Jira via atlas-run/atlas-debug and ngrok proxy?

I am trying to run Jira locally via atlas-run/atlas-debug and expose it via ngrok to the internet (HTTPS). If I just do atlas-run I get a bunch of [c.a.p.r.c.security.jersey.XsrfResourceFilter] Additional XSRF checks failed for request logs which, as far as I understand, are an effect of Tomcat not knowing about the ngrok proxy.

Basically, I want this, where Apache is ngrok proxy:
image
image source

How can I configure connector in server.xml for atlas-run?

Tried to configure default connector in target/container/tomcat8x/cargo-jira-home/conf/server.xml to add proxyName and proxyPort and change scheme to https. The problem here is that this config gets overridden with the default connector when I do atlas-run/atlas-debug.

Any help/hints or links to some secret hidden docs or community post that I didn’t manage to google yet would be appreciated.

Thanks!

Does anyone know how to configure AMPS to set proxyName, proxyPort and scheme for the Tomcat container?

If I change the server.xml in target/container/tomcat8x/cargo-jira-home/conf/server.xml it gets reset to the standard config as soon as I do atlas-run/atlas-debug/atlas-run-standalone.

I managed to change the connector easily for a standard Jira installation (not started via AMPS, download purchased Jira app and start it) with the following config:

<Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
        maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
        maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
        acceptCount="100" disableUploadTimeout="true" bindOnInit="false" secure="true" scheme="https"
        proxyName="ea1129c9.ngrok.io" proxyPort="443"/>