3

I am not sure if this is an nginx config issue, a traefik config issue, or a general docker networking issue.

I assume there is a simple setting somewhere that will make it possible.

I have etopian/alpine-php-wordpress running great behind traefik.

Simply Static is a wordpress plugin that crawls the site and adapts the results into a static site with relative paths. To do that Wordpress needs to be able to "make requests to itself", and the Simply Static Diagnostic page gives me a red X because it can't.

I tried some commandline wgets from within the container:

bash-4.3# wget http://edit.example.com
Connecting to edit.example.com (172.24.x.y:80)
wget: error getting response: Invalid argument
bash-4.3# wget https://edit.example.com
Connecting to edit.example.com (172.24.x.y:443)
wget: can't connect to remote host (172.24.x.y): Connection refused
bash-4.3# wget https://edit.example.com:80
Connecting to edit.example.com:80 (172.24.x.y:80)
wget: can't execute 'ssl_helper': No such file or directory
wget: error getting response: Connection reset by peer

I also tried adding an extra host to docker-compose:

extra_hosts:
  - "edit.example.com:{{actual.ip.add.ress}}

Still fails, but the IP address shown in the Simply Static Diagnostics changes to the external actual ip of the machine (hardcoded where i put {{actual.ip.add.ress}} above).

These results make me lean towards an nginx config fix. As it seems that edit.adanj.com is correctly resolved to the internal (or external) ip of the docker container, and nginx is not allowing the connection.

Any help?

gotjosh
  • 831
  • 3
  • 9
  • 18

1 Answers1

1

I found a solution that feels quite hackish:

extra_hosts:
      - "edit.example.com:172.trae.fik.ip"

Using the full internal ip of the traefik container on the docker network.

I think that the problem was that Simply Static is trying to make requests via https, which is usually handled by traefik, and the internal nginx within the wordpress container is not listening on 443... So sending those requests around to the frontdoor allows traefik to handle the ssl business and the requests work.

Curious if there are other solutions...

gotjosh
  • 831
  • 3
  • 9
  • 18
  • It is a general docker networking issue. The only solution i found was to use a lemp dockerfile (or the dockerhub wordpress image). This bypasses the problem. – pixeline Jul 20 '22 at 18:46