Wordpress & Nginx with Docker: Static files not loaded

admin

Administrator
Staff member
I'm using Docker to serve my simple WordPress website. A nginx container and a wordpress container. Simple setup:

Code:
upstream wordpress_english {
  server wordpress_en:80;
}

server {
  listen 80;
  server_name my_domain.com www.my_domain.com;

  location / {
        proxy_pass http://wordpress_english;
    }
}

<strong>Problem:</strong> Static files (css, js and images) are not loaded.

The output from the browser console shows a 404:

Code:
http://wordpress_english/wp-content/themes/twentyfifteen/genericons/genericons.css?ver=3.2

Its easy to spot the problem: The browser looks for the static files at wordpress_english (the nginx upstream name), instead of
Code:
my_domain.com

How can I fix this problem?