Headers not set correctly in your instance

Clean build of nextcloud using docker and portainer on a debian 12 host system with the nextcloud behind a traefik reverse proxy.
NC Hub 10 (31.0.4)
Portainer BE: 2.275 LTS
Traefik: 3.3.6 as a reverse proxy

I’m getting the error warning

Some headers are not set correctly on your instance
‘X-Robots-Tag’ HTTP header is not set to noindex,nofollow
‘X-Frame-Options’ HTTP header is not set to sameorigin

I’ve checked the .htaccess in the nextcloud directory and see

Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"    

Header onsuccess unset X-Robots-Tag
Header always set X-Robots-Tag "noindex, nofollow"

Do I need to set anything in the reverse proxy or anywhere else for these headers?

we have many topics here please look at setup_warning tag

I’ve gone through the various posts here and can’t see anything that gives me a clue to a solution for this.
Is it something I need to tweak in the docker container, the NC config.php or something I need to add on the reverse proxy middleware?

Any help to resolve this would be much appreciated!

Finally found what looks to be causing the problem!

https://headers.4tools.net/ showed the header settings were not what was set in the docker container. Tracked it down to one of the middlewares on my traefik. I need to do a bit of readjustment and that should solve the problem (hopefully)