How to set server_tokens=off using docker-compose with nginx

Hello,
I have setup seafile-pro V7.0 with docker-compose using https with Letsencrypt.
I used the suggested docker-compose.yml referenced by the manual

To increase security I would like to set
server_tokens off;
in the nginx-config.This is also mentioned in the manual at Enabling Https with Nginx

The Problem:
The nginx configfile gets autogenerated by the used docker image.

Is there a way to define config options for nginx that can be set in the docker-compose file?

  • I don’t want to create my own dockerfile if possible for easier upgrades :slight_smile:

Thanks!

You can try to specify a persistent path for nginx in your docker .yml file and create your own config.

  seafile:
    image: seafileltd/seafile-mc:latest
    ports:
      - "0.0.0.0:80:80"
   volumes:
      - /opt/seafile-nginx:/etc/nginx/sites-enabled
      - /opt/seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
environment:
  [....]