Docker Community Forums

Share and learn in the Docker community.

Nginx & Wordpress

Hi to all. i am newbie in Docker.
I am trying to setup in a raspberry pi a docker with Nginx proxy server and wordpress

i have manage to install in my raspberry pi docker, portainer, nginx, nginx proxy manager and wordpress

when i visit my local ip :80 i can see nginx welcome page.
when i visit my local ip:81 i can login to nginx manager page
when i visit my local ip :8181 i can see my wordpress setup page (i am using port 8181 for wordpress, i have open the port in router)

my problem is that when i am in proxy manager page and setup the page it is like not to do anything… i am getting an error " 400 Bad Request. Your request has bad syntax or is inherently impossible to satisfy." when i am trying to reach my wordpress from the domain i want to use

if i use my domain with the port:8181 then i can see my wordpress (www.mydomain.com:8181)

i think something has to do with the network inside the docker . i am not sure if i am setting it up right.

any help?

here are my docker-compose.yml files i used to install nginx , wordpress

Nginx Manager
created folder named ‘nginx’
create ‘config.json’ file with

}

{
"database": {
"engine": "mysql",
"host": "db",
"name": "npm",
"user": "myuser",
"password": "myuserpassword",
"port": 3306
}
}

then i used this comand to make a network :

docker network create --driver bridge nginx-proxy

then i creat at same folder a docker-compose.yml file with :

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "myuser"
      DB_MYSQL_PASSWORD: "myuserpassword"
      DB_MYSQL_NAME: "npm"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
  db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'myuserpassword'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'myuser'
      MYSQL_PASSWORD: 'myuserpassword'
    volumes:
      - ./data/mysql:/var/lib/mysql

networks:
  default:
    external:
      name: nginx-proxy

and for wordpress i creat a newfolder named “wordpress-site1”
inside this folder i created a docker-compose.yml file with :



version: '3.3'

services:
   db:
     container_name: db-site1
     image: hypriot/rpi-mysql
     volumes:
       - ./db_data:/var/lib/mysql
       - ./home/db:/home/db
       - ./sqldump:/sqldump
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: myuserpass
       MYSQL_DATABASE: wordpress
       MYSQL_USER: myuserWordpress
       MYSQL_PASSWORD: myuserpass

   wordpress:
     container_name: wordpress-site1
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - 8181:80
     restart: always
     volumes:
       - ./data_volume:/var/www/html
       - ./home/wp:/home/wp
     environment:
       VIRTUAL_HOST: www.mydomain.com
       LETSENCRYPT_HOST: www.mydomain.com
       LETSENCRYPT_EMAIL: myuser@gmail.com
       WORDPRESS_DB_HOST: db_site2:3306
       WORDPRESS_DB_USER: myuserWordpress
       WORDPRESS_DB_PASSWORD: myuserpass
       WORDPRESS_DB_NAME: wordpress
     links:
       - db:db_site1

networks:
  default:
    external:
      name: nginx-proxy

Any help-suggestion is welcome
Thanks in advance