Hello,
How can i prevent that the mailcow UI is shown over http connection, so i want to disable it or having it redirected to https.
i changed /data/conf/nginx/listen_plain.active as follows:

server {
	listen 8080;
	listen [::]:8080;
	server_name _;
	return 301 https://$host$request_uri;
}

but after restarting nginx (docker-compose restart nginx-mailcow) this file (listen_plain.active) was reset to its original contents:

	listen 8080;
	listen [::]:8080;

Many thanks in advance

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

hi, thanks!
I overlooked that although I try to avoid bothering people with maybe silly question.
Now I see that the search of mailcow community is not covering mailcow documentation. So my search was too narrow. My apologies & thanks for the “redirect” ;-)

All good. You’re welcome! 🙂

I can confirm it worked, even with different ports, FYI

server {
  root /web;
  listen 8080 default_server;
  listen [::]:8080 default_server;
  include /etc/nginx/conf.d/server_name.active;
  if ( $request_uri ~* "%0A|%0D" ) { return 403; }
  location ^~ /.well-known/acme-challenge/ {
    allow all;
    default_type "text/plain";
  }
  location / {
    return 301 https://$host:8443$uri$is_args$args;
  }
}
No one is typing