I am trying to setup a Ubuntu 16.04 machine such that an nginx-proxy container would reverse-proxy to a wordpress container.
The issue I am having is that when trying to access the website from the outside world, nginx only forwards some GET requests, viz. the HTML of the home page and the favicon. It doesn't forward any other requests to load the other elements of the page.
Here is my docker-compose.yml:
version: "2"
services:
mysql:
image: mysql:latest
container_name: db
restart: always
environment:
- MYSQL_ROOT_PASSWORD=SuperSecretMysqlPassword
volumes:
- /home/docker-stuff/var-lib-mysql:/var/lib/mysql
nginx-proxy:
image: jwilder/nginx-proxy:alpine
container_name: nginx
restart: always
ports:
- "443:443"
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
wordpress:
image: wordpress:latest
container_name: wp
restart: always
environment:
- VIRTUAL_HOST=example.com
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=SuperSecretWordpressPassword
volumes:
- /home/wp/:/var/www/html/
Here is the output from docker-compose up
when I try to access the website (on port 80):
nginx | nginx.1 | 92.222.75.87 172.18.0.1 - - [23/Jun/2017:18:26:20 +0000] "POST /wp-cron.php?doing_wp_cron=1498242380.0386610031127929687500 HTTP/1.1" 503 213 "http://92.222.75.87/wp-cron.php?doing_wp_cron=1498242380.0386610031127929687500" "WordPress/4.8; https://92.222.75.87"
wp | 172.18.0.3 - - [23/Jun/2017:18:26:19 +0000] "GET / HTTP/1.1" 200 17780 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | example.com 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET / HTTP/1.1" 200 17467 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/images/header.jpg HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/style.css?ver=4.8 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-includes/js/jquery/jquery.js?ver=1.12.4 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver=1.0 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/js/global.js?ver=1.0 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/js/jquery.scrollTo.js?ver=2.1.2 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-includes/js/wp-embed.min.js?ver=4.8 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-includes/js/wp-emoji-release.min.js?ver=4.8 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/images/header.jpg HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js?ver=1.0 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/js/global.js?ver=1.0 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-content/themes/twentyseventeen/assets/js/jquery.scrollTo.js?ver=2.1.2 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | 92.222.75.87 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /wp-includes/js/wp-embed.min.js?ver=4.8 HTTP/1.1" 503 213 "http://example.com/" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
wp | 172.18.0.3 - - [23/Jun/2017:18:26:20 +0000] "GET /favicon.ico HTTP/1.1" 200 192 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
nginx | nginx.1 | example.com 146.198.151.82 - - [23/Jun/2017:18:26:20 +0000] "GET /favicon.ico HTTP/1.1" 200 0 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
All images freshly pulled from docker hub. I tried "jwilder/nginx-proxy:latest" instead of alpine, same results...
I don't know nginx very well, so I would really appreciate some help here... Thanks a lot in advance!