• Hi guys.

    How does one go about setting up – in my case Nginx – a cache proxy for containerized WordPress?
    I do not suppose same rules nor recipes apply as when Nginx serves WordPress directly?
    Perhaps not all Docker images are good, or even are discouraged when Nginx on host is meant to be front-end to such WordPress?

    Any & all thoughts & advice are much appreciated.

    many thanks, L.

Viewing 1 replies (of 1 total)
  • Run Nginx as a caching reverse proxy in its own container on the same Docker network as your WordPress container, so the whole setup stays portable and independent of the host. The same caching principles apply as when Nginx serves WordPress directly, but instead of fastcgi_pass to a local PHP socket you proxy_pass to the WordPress container’s service name over HTTP, and you must forward the Host header plus client IP headers so WordPress generates correct URLs. Exclude wp-admin, wp-login.php, and requests with logged-in cookies from the cache to avoid serving private content. Any plain WordPress image works fine as an upstream, so no special image is needed, just keep Nginx and WordPress as separate containers.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.