this one helps. The problem is about network configuration I suppose. Your container uses port 80 for wordpress and your host uses the same port for nginx. When you use net: "host"(https://docs.docker.com/engine/reference/run/#/network-settings), your container uses the host's network stack and they conflict trying to bind to the same port. If your mysql server is remotely accessible just remove the net: "host" part and replace the mysql host configuration to how you would connect to it remotely. It should just work.
will be helpful for those in need nginx evaluates location blocks according to various rules as explained by the documentation. To give your location /blog/ a higher precedence than location ~ \.php$, use the ^~ modifier:
I think the issue was by ths following , It does not work because /wp-json is not a real file or directory, without reading the .htaccess, local requests will get a 404 not found response, so Apache will continue to forward the request to remote server. To fix this URL rewriting we need to send the requests to the local index.php.