2022-02-02 12:23:46 +01:00
Since February the 28th 2017 mailcow does come with port 80 and 443 enabled.
2023-06-14 00:15:06 +02:00
**Do not use the config below for reverse proxy setups**, please see our [reverse proxy guide ](../post_installation/reverse-proxy/r_p.md ) for this, which includes a redirect from HTTP to HTTPS.
2022-02-02 12:23:46 +01:00
Open `mailcow.conf` and set `HTTP_BIND=` - if not already set.
Create a new file `data/conf/nginx/redirect.conf` and add the following server config to the file:
```
server {
root /web;
listen 80 default_server;
listen [::]:80 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$uri$is_args$args;
}
}
```
In case you changed the HTTP_BIND parameter, recreate the container:
2023-01-13 18:16:08 +01:00
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker compose up -d
```
2022-02-02 12:23:46 +01:00
Otherwise restart Nginx:
2023-01-13 18:16:08 +01:00
=== "docker compose (Plugin)"
``` bash
docker compose restart
```
=== "docker-compose (Standalone)"
``` bash
docker compose restart
2023-06-14 00:15:06 +02:00
```