2017-05-06 00:22:26 +02:00
|
|
|
Since February the 28th 2017 mailcow does come with port 80 and 443 enabled.
|
|
|
|
|
2018-10-16 12:09:35 +02:00
|
|
|
**Do not use the config below for reverse proxy setups**, please see our reverse proxy guide for this, which includes a redirect from HTTP to HTTPS.
|
|
|
|
|
2017-05-06 00:22:26 +02:00
|
|
|
Open `mailcow.conf` and set `HTTP_BIND=0.0.0.0` - if not already set.
|
|
|
|
|
2019-10-20 20:01:28 +02:00
|
|
|
Create a new file `data/conf/nginx/redirect.conf` and add the following server config to the file:
|
2017-05-06 00:22:26 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
server {
|
2019-10-20 20:01:28 +02:00
|
|
|
root /web;
|
2017-11-20 22:36:37 +01:00
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
2019-10-20 21:58:01 +02:00
|
|
|
include /etc/nginx/conf.d/server_name.active;
|
2018-12-27 19:05:22 +01:00
|
|
|
if ( $request_uri ~* "%0A|%0D" ) { return 403; }
|
2019-10-20 20:01:28 +02:00
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
|
|
allow all;
|
|
|
|
default_type "text/plain";
|
|
|
|
}
|
|
|
|
location / {
|
|
|
|
return 301 https://$host$uri$is_args$args;
|
|
|
|
}
|
2017-05-06 00:22:26 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
In case you changed the HTTP_BIND parameter, recreate the container:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose up -d
|
|
|
|
```
|
|
|
|
|
|
|
|
Otherwise restart Nginx:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose restart nginx-mailcow
|
|
|
|
```
|