Nginx Docker add header

Hello,

i try to add the following security headers for the nginx:

  • Content-Security-Policy
  • X-Frame-Options

i added them in /docker-jitsi-meet/web/rootfs/defaults/meet.conf like:

If you stop my docker containers with “docker-compose stop” and restart them with “dock-compose up --build” the headers are not added.

Are there any clues what i did wrong?

You need to build your own docker image.

  1. cloning docker-jitsi-meet repo
  2. add the changes in /web/config/meet.conf file
  3. build your docker image

i did the following steps:

  • removed docker image with 'docker container rm <container_id>
  • made my changes in the web/rootfs/defaults/meet.conf file
  • run ‘docker-compose up -d’

→ still no headers

once u made the changes then got to web directory and run docker image build -t trace/web:v1 and use trace/web:v1 in docker-compose file.

here trace is your docker hub username in case you want to push it to dockerhub. This can be a random string as well if you are only testing it on local. recommend is to use docker hub username.

web: container name like jitsi is using jitsi/web
v1: docker image version.

1 Like

Finally i made it. Thank you very much @metadata for your advice. I simply misunderstood how docker works. As far as i “understand” right now, if a container is build, you can’t configure it from outside (without .env), you have to build a new one.

Actually you can use bind mounts like you can map meet.conf to /config/nginx/meet.conf path.
meet.conf is your local machine path and /config/nginx/meet.conf is the path inside docker container.

I never tried this method so not sure about the success rate. I prefer to build images as it allows me to try unstable version too.