nginx reverse proxy and multiple workdpress.
domain name | domain type |
---|---|
hoge.com | A record |
fuga.hoge.com | CNAME record |
fix your domain.
git clone https://github.com/mews-iidx/multi-wp
apt install certbot
certbot certonly --webroot -w /usr/share/nginx/html -d hoge.com -d fuga.hoge.com
cp /etc/letsencrypt/live/hoge.com/privkey.pem ~/hoge.com/hoge.com.key
cp /etc/letsencrypt/live/hoge.com/fullchain.pem ~/hoge.com/hoge.com.crt
cd multi-wp/proxy
docker-compose up -d
fix .env
file.
CERT_PATH=~/hoge.com #FIX
NETWORK_NAME=mynetwork
cd hoge.com
docker-compose up -d
cd fuga.hoge.com
docker-compose up -d
fix .env
file.
WP_CONTAINER_NAME=hoge-container-wp
DB_CONTAINER_NAME=hoge-container-db
WP_DBNAME=my-wp
DB_USER=admin
DB_PASSWORD=user_password
DB_ROOT_PASSWORD=root_password
DOMAIN=hoge.com
NETWORK_NAME=mynetwork
open https://hoge.com
and https://fuga.hoge.com