• Resolved iowebgr

    (@iowebgr)


    Hi,

    I’m running Varnish inside a Docker container. It listens on multiple interfaces, including 127.0.0.1, the Docker bridge IP, and the container’s internal IP.

    Since container IPs can change, I prefer to use the host-mapped port where Varnish is exposed on 127.0.0.1.

    My question is:
    Can I specify an IP:Port combination in the plugin’s IP field, or is there a separate way to define the port?

    Could you please advise on the correct configuration for this setup?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Danila Vershinin

    (@dvershinin)

    Hi @iowebgr,

    Yes, you can specify IP:Port directly in the Custom IP field. For example, if your Varnish is exposed on port 6081 on localhost, enter:

    127.0.0.1:6081

    in Settings → Proxy Cache Purge → Settings tab → Set Custom IP.

    Alternatively, you can define it in wp-config.php:

    define( ‘VHP_VARNISH_IP’, ‘127.0.0.1:6081’ );

    The plugin will send PURGE requests to http://127.0.0.1:6081/path with the correct Host header set to your site’s domain, so Varnish knows which content to purge.

    This has been supported since version 4.4.0. I’ve also updated the settings page examples to make this more discoverable in the next release.

    Thread Starter iowebgr

    (@iowebgr)

    Thank you very much, @dvershinin

    I wasn’t sure if this was supported since the setting only mentions an IP (and not IP:Port), so I assumed there might be a separate option or filter for specifying the port.

    Turns out I should have just tried it first 😄

    Appreciate the clarification and the upcoming improvement to the settings page that will definitely make things clearer

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.