Docker Community Forums

Share and learn in the Docker community.

Docker Nextcloud with Nginx Proxy on Host

Hi there,

got a problem with DNS Resolution it seems.

Got a container with MariaDB
Got a container with nextcloud app
Nginx forwards 443 to the nextcloud app

Nextcloud Setup worked with manual set IP address for the DB.

All worked fine on the webinterface, but now i wanted to connect a client app and it requires a authentification - problem is now the url gets changed 3 times to the manual set IP address showed in the browser address bar. I manipulated it then manually and it goes further in the auth process but fails then on the 3rd manual manipulation. Where does this come from?

compose file:

version: ‘3’

volumes:
nextcloud:
db:

networks:
frontend:
ipam:
config:
- subnet: 10.20.0.0/24

services:
db:
hostname: mariadb
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
container_name: mariadb
environment:
- MYSQL_ROOT_PASSWORD=xxx
- MYSQL_PASSWORD=xxx
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
frontend:
ipv4_address: 10.20.0.10

app:
hostname: nextcloud
image: nextcloud
links:
- db
container_name: nextcloud
volumes:
- nextcloud:/var/www/html
restart: always
networks:
frontend:
ipv4_address: 10.20.0.20

nginx config file:

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

#gzip  on;

server
{
listen 80;
listen 443 ssl http2;

ssl_certificate		/etc/letsencrypt/live/*/fullchain.pem;
ssl_certificate_key	/etc/letsencrypt/live/*/privkey.pem;

ssl_protocols TLSv1.3;


location / {
	proxy_pass http://10.20.0.20/ ;
}

}
}

really, nothing?? …