nextcloud-docker-dev icon indicating copy to clipboard operation
nextcloud-docker-dev copied to clipboard

Ngnix starts with wrong port configuration after second installation

Open DJE98 opened this issue 3 years ago • 3 comments

I ran the default configuration script a second time after I deleted the previous folder and the created network in docker.

sudo rm -rf nextcloud-docker-dev
sudo docker network rm $(sudo docker network ls -q)
git clone https://github.com/juliushaertl/nextcloud-docker-dev
cd nextcloud-docker-dev
./bootstrap.sh
sudo sh -c "echo '127.0.0.1 nextcloud.local' >> /etc/hosts"
docker-compose up nextcloud proxy
́̀```

Now I see on the last step, that nginx will be started on 5100, but `docker ps` shows me that the configuration exposes 80:80. So the default nextcloud instance can't be visited under  `nextcloud.local`.

̀```
nextcloud_1          | ⌛ Waiting for other containers
nextcloud_1          |  - MySQL
proxy_1              | Info: running nginx-proxy version 1.0.1-6-gc4ad18f
proxy_1              | Skipping Diffie-Hellman parameters setup.
proxy_1              | Warning: The DHPARAM_GENERATION environment variable is deprecated, please consider using DHPARAM_SKIP set to true instead.
proxy_1              | forego      | starting dockergen.1 on port 5000
proxy_1              | forego      | starting nginx.1 on port 5100
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: using the "epoll" event method
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: nginx/1.21.6
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: OS: Linux 5.18.0-kali7-amd64
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: getrlimit(RLIMIT_NOFILE): 1048576:1048576
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker processes
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 24
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 25
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 26
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 27
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 28
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 29
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 30
proxy_1              | nginx.1     | 2022/10/16 21:43:36 [notice] 19#19: start worker process 31
proxy_1              | dockergen.1 | 2022/10/16 21:43:36 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
proxy_1              | dockergen.1 | 2022/10/16 21:43:36 Watching docker events
proxy_1              | dockergen.1 | 2022/10/16 21:43:36 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'

DJE98 avatar Oct 16 '22 22:10 DJE98

nextcloud.local site worked probably after restart. I think the script doesn't start all container properly.

DJE98 avatar Oct 16 '22 22:10 DJE98

I don't think that nginx was started with the port, but forego which is a part of the nginx proxy container for automatically detecting the config. According to the log bit you pasted the nextcloud container was not ready yet, so nginx would not be able to reach it yet.

It should be ready and reachable once your logs show a 🚀 Starting apache for the nextcloud container.

juliusknorr avatar Oct 17 '22 06:10 juliusknorr

sudo rm -rf nextcloud-docker-dev sudo docker network rm $(sudo docker network ls -q)

Best would be to run docker-compose down -v before deleting inside of the previous folder, as that would clean up the running containers/volumes and networks.

juliusknorr avatar Oct 17 '22 06:10 juliusknorr

Closing as the questions seemed to be answered. Let me know if something is still not working

juliusknorr avatar Nov 27 '22 12:11 juliusknorr