• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue bind(): Cannot assign requested address - Error Log- while using Varnish for WordPress in a Docker

OLAT

New Pleskian
Base on this article Varnish for WordPress in a Docker container - Plesk

I implement the procedure but the Varnish Cache keeping MISSING.

Details of my server:
OS ‪CentOS Linux 7.3.1611 (Core)‬
Product Plesk Onyx
Version 17.0.17

Details of the problem:
The varnish container is showing the following error log

bind(): Cannot assign requested address
child (16) Started
Child (16) said Child starts
Manager got SIGINT
Stopping Child
Child (16) ended
Child (16) said Child dies
Child cleanup complete

And when i tested the varnish here Domain Default page it is always "MISS"

PLEASEHELP
 
Although I got some great help from Olat I still can not get this to work. I have tried several settings (with and without Nginx) but still no luck. I have used the https://www.plesk.com/blog/product-technology/varnish-wordpress-docker-container instructions but always same issue.

I use Plesk Onyx with several IP's for my customers.

In the default.vcl of the Million12 Varnish Docker I have filled in IP and Port I hope that someone can helpo me on this. I ahve few questions:

- What IP do I use? The IP of the Plesk Admin installation (main IP) or the IP of the hoisting environment of the specific subscription I want to use the docker on.
- The Port, I have tried 80, 8080, 7080. What Port should I use for the specific PHP Settings FPM Apache, Nginx etc,
- Do I have to setup Volume Mapping

Issues I have:
bind(): Cannot assign requested address
child (16) Started
Child (16) said Child starts
Manager got SIGINT

Cache: MISS

Does nybody have got this working with Plesk Onyx and Nginx or Apache?

Thanks,
KooTjoo
 
Hi all,

Is there already an updated answer with a solution?
I still have issues with this, always that the address can't be assigned and still 503 and 'MISS" as check.
For the host, I choose the IP that's displayed on the dashboard in Plesk, the IP is 7080 (port for httpd).
This is for a single page, not Wordpress.

Thanks,
Mike
 
This seems related to a firewall.

I haven't figured out which rule specifically is required and I don't recommend running the server without a firewall.
 
Last edited:
The following error:

Code:
bind(): Cannot assign requested address

is most likely due to the fact that the docker image in this case does not have an ipv6 interface and varnish tries to bind on all interfaces.

So you can safely ignore it in this case.

I was actually thrown off by this error and thought it was the reason for my varnish containers to not cache content but it was actually a firewall problem.

The docker image needs to be able to talk to the apache webserver. This is what was causing my issue. All docker images get an ip in the 172.17.0.0/16 range. So add specify in the firewall that this range is allowed to talk to port 7080.

In Plesk's firewall you can add the following rule:
* Allow incoming from 172.17.0.0/16 on port 7080/tcp

The network diagram looks like this:
Code:
                Plesk stack without varnish

               +-------------+      +--------------+
               |             |      |              |
visitors +----->  nginx:80   +------>  httpd:7080  |
               |  nginx:443  |      |  httpd:7081  |
               |             |      |              |
               +-------------+      +--------------+



                Plesk stack with varnish

               +-------------+     +----------------+    +--------------+
               |             |     |                |    |              |
visitors +----->  nginx:80   +----->  varnish       +---->  httpd:7080  |
               |  nginx:443  |     |  docker:22780  |    |  httpd:7081  |
               |             |     |                |    |              |
               |  server-ip  |     |  172.17.0.2    |    |  127.0.0.1   |
               +-------------+     +----------------+    +--------------+

You can debug the traffic between the webserver and docker containers by looking up its name and then entering it to see if a connection is possible:
Code:
docker ps #check the names column

Enter the docker image by specifying its name from the previous command, mine is called varnish:
Code:
docker exec -it varnish bash
Check you can reach the webserver via curl so:
Code:
curl -I server-ip:7080
HTTP/1.1 200 OK

200 OK means the docker image can reach the webserver to cache its content. Otherwise you'd be getting timeout errors because the firewall is blocking access.

I hope this will be of some help to others!
 
Last edited:
This thread helped me a lot to get Varnish Docket working with Magento 2.

I use:
- Varnish Million12
- PHP7.1 with Nginx Proxy

All seems to work wel when I enable Varnish in Magento 2 however if I enable SSL I get Too many redirect Issues when I try to open a page. I see this issue on pop up with other docker users but I have not been able to find the solution for this. Is there anybody that can get me in the right direction?

Thanks,
KooTjoo
 
Sorry to bump this topic but does anyone have a solution for this? All works like a charm without SSL but as soon as I activate it I get redirect loops ERR_TOO_MANY_REDIRECTS.
 
Back
Top