wmnnd / nginx-certbot

Boilerplate configuration for nginx and certbot with docker-compose
MIT License
3.15k stars 1.17k forks source link

problems when setting up an application in a different docker-compose.yml #119

Open Inkimar opened 3 years ago

Inkimar commented 3 years ago

Hi,

I am having problem when setting up the service as-is, it is not finding my wordpress instance running on a specifik URL (i.e example.org) / not redirecting to the URL. The setting is this.

  1. running the init-letsencrypt.sh after editing it.
  2. home/user/repository/proxy-docker/docker-compose.yml

version: '3.7'

services: nginx: image: nginx:1.15-alpine container_name: nginx_1 restart: unless-stopped ports:


2. spinning up this `docker-compose up -d`gives me the network -> **proxy-docker_default** 
3. Running wordpress from this site -> https://github.com/chrisbmatthews/wordpress-docker-compose.git 
4. home/user/repository/wordpress-docker-compose/docker-compose.yml

version: '3.7'

services: wp: image: wordpress:5.8.1-apache container_name: wordpress restart: unless-stopped volumes:

volumes: db_data:

networks: default: external: name: proxy-docker_default # attaching to the network that nginx/certbot is running


5. inspecting the -network, `docker inspect proxy-docker_default` , gives (a subset  of the output) 

"Containers": { "2f266b1a36207486fbe127ae7802fcd21518892a883671292c40867f1c2b0bd6": { "Name": "nginx_1", "EndpointID": "a8de3d8f5fcead1cb090fb52c256f7b4a69d7646d0407f94372faccefe1af900", "MacAddress": "02:42:ac:1a:00:02", "IPv4Address": "172.26.0.2/16", "IPv6Address": "" }, "66cc035957e0325905e7c093ddadee41816154e3cb729b273e766015c58ae699": { "Name": "wordpress", "EndpointID": "ecb847e0b282cc4a8679ee31c0df320d40a448e345ae244873fc06db06a7512e", "MacAddress": "02:42:ac:1a:00:05", "IPv4Address": "172.26.0.5/16", "IPv6Address": "" }, "93d6aed6ddc30a4cad2231c9cd0b2cc944dbdf07524ed6d25d86120f1ba5e5d1": { "Name": "proxy-docker_certbot_1", "EndpointID": "0aa79a3876dc1c556b1d3f58eb27dd733ecd6b8ba855c08de9976da06e550feb", "MacAddress": "02:42:ac:1a:00:03", "IPv4Address": "172.26.0.3/16", "IPv6Address": "" }, "c623641458fd1274948b3e3c84e007ab60f9292d1498722561ae31929a72e7cc": { "Name": "wordpress-docker-compose_db_1", "EndpointID": "795e0ce8131a21ee917e3a6bc5faea5c2583272e4e4420b9e4e067b59f5a8a16", "MacAddress": "02:42:ac:1a:00:04", "IPv4Address": "172.26.0.4/16", "IPv6Address": "" } }, "Options": {}, "Labels": { "com.docker.compose.network": "default", "com.docker.compose.project": "proxy-docker", "com.docker.compose.version": "1.27.4" } }

6. accessing wordpress by browser gives 

The page isn’t redirecting properly This problem can sometimes be caused by disabling or refusing to accept cookies.


Looking at the logs for nginx, I can see an incoming request but I cannot se anything in the wordpress log ....
 **** 

Replacing the nginx/certbot proxy with the one below (no app.conf) then the forwarding from nginx to wordpress works (`VIRTUAL_HOST: example.org` ) 

version: '3.7'

services:

nginx-jwilder: image: jwilder/nginx-proxy ports:

Could I make this work by editing the data/nginx/app.conf adding som config ?

Best, i

Cosmicoppai commented 3 years ago

can you show the nginx configuration file.