I also search other questions but they don't fit me. (Docker nginx reverse proxy gives "502 Bad Gateway" or docker nginx 502 bad gateway)
In my situation, I install docker-ce to my personal VPS server as given:
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Wed Jun 20 21:43:51 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Wed Jun 20 21:42:00 2018
OS/Arch: linux/amd64
Experimental: false
then
pull standard latest version of wordpress, mysql
and jwilder/nginx
reverse proxy
And use standard codes as given
MYSQL:
docker run --name myweb_com_mysql -v /opt/docker-volumes/myweb_com_mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD="myweb41#D_fG" --restart unless-stopped -d mysql
Wordpress :
docker run --name myweb_com_wordpress --link myweb_com_mysql:mysql -p 127.0.0.1:48010:80 -v /opt/docker-volumes/myweb_com_wordpress:/var/www/html -e VIRTUAL_HOST="myweb.com,www.myweb.com" --restart unless-stopped -d wordpress
and NGINX REVERSE PROXY:
docker run -d -p 80:80 --name nginx-proxy -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy
What is wrong with that?
Regards