Closed NickUfer closed 6 years ago
You can just remove the port binding in docker-compose.yml => - HTTP_PORT=${HTTP_PORT:-80}
.
There is no Dockerfile for nginx-mailcow, I wonder what you changed?
Port 80 is exposed in Nginx' official Dockerfile here: https://github.com/nginxinc/docker-nginx/blob/master/mainline/stretch/Dockerfile - but as long as there is no binding, there is no service on that port. Not even internal. This just shows port 80 as exposed but unbound.
I have checked it again and I already removed the binding and still it doesn't work. The container still binds to port 80 and serves the nice "Welcome to Nginx" site...but there are no bindings....
How can it bind to port 80 and not have bindings? :-)
How do you test it? Do you exec into the container? Or do you curl the container from another container?
http://www.nick-ufer.de that's the nginx-mailcow container.
nginx-mailcow:
depends_on:
- sogo-mailcow
- php-fpm-mailcow
- redis-mailcow
image: nginx:mainline-alpine
command: /bin/sh -c "envsubst < /etc/nginx/conf.d/templates/listen_plain.template > /etc/nginx/conf.d/listen_plain.active &&
envsubst < /etc/nginx/conf.d/templates/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active &&
envsubst < /etc/nginx/conf.d/templates/server_name.template > /etc/nginx/conf.d/server_name.active &&
envsubst < /etc/nginx/conf.d/templates/sogo.template > /etc/nginx/conf.d/sogo.active &&
envsubst < /etc/nginx/conf.d/templates/sogo_eas.template > /etc/nginx/conf.d/sogo_eas.active &&
nginx -qt &&
until ping phpfpm -c1 > /dev/null; do sleep 1; done &&
until ping sogo -c1 > /dev/null; do sleep 1; done &&
until ping redis -c1 > /dev/null; do sleep 1; done &&
until ping rspamd -c1 > /dev/null; do sleep 1; done &&
exec nginx -g 'daemon off;'"
environment:
- HTTPS_PORT=${HTTPS_PORT}
- HTTP_PORT=${HTTP_PORT}
- MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
- IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
- TZ=${TZ}
volumes:
- ./data/web:/web:ro
- ./data/conf/rspamd/dynmaps:/dynmaps:ro
- ./data/assets/ssl/:/etc/ssl/mail/:ro
- ./data/conf/nginx/:/etc/nginx/conf.d/:rw
- ./data/conf/rspamd/meta_exporter:/meta_exporter:ro
volumes_from:
- sogo-mailcow
ports:
- "127.0.0.1:4521:4521"
- "127.0.0.1:4520:4520"
restart: always
dns:
- ${IPV4_NETWORK:-172.22.1}.254
networks:
mailcow-network:
aliases:
- nginx
0dee0036ac47 nginx:mainline-alpine "/bin/sh -c 'envsubs…" 38 hours ago Up 38 hours 80/tcp, 127.0.0.1:4520-4521->4520-4521/tcp mailcowdockerized_nginx-mailcow_1
Even if I hardcode the ports it doesnt work
ports:
- "127.0.0.1:4521:4521"
- "127.0.0.1:4520:4520"
mailcows nginx is not bound to 80.
The nginx you are seeing there is not mailcow, see the headers it sends: Server: nginx/1.14.0 (Ubuntu)
We do a) not expose the version and b) not use Ubuntu.
Omg...recently I renewed my letsencrypt certificates and the certbot installed a nginx server....thanks for your help
Hehe, no problem!
No matter how I change my config, edit the Dockerfiles or the Docker-Compose file, Nginx is using port 80.
nginx:mainline-alpine "/bin/sh -c 'envsubs…" 10 seconds ago Up 8 seconds 80/tcp, 127.0.0.1:4520-4521->4520-4521/tcp
necessary parts of mailconf.conf
I really dont have to say much more about that because I don't know how I should handle such a stupid behaviour