Nginx proxy wordpress in docker, direct access to domain name will be redirected to wordpress port.

  docker, question

Environment:
1.wordpress and mysql are installed with docker, and wordpress’s port is 8080.
2.nginx is installed directly in utuntu.

Problem description:

Direct accesshttp://www.zhuyuntao.com, will be redirected to 8080. However, redirection is not configured in nginx.

The configuration of the/etc/nginx/sites-available/default file is as follows.

server {
 listen 80;
 
 server_name  www.zhuyuntao.com ;
 
 location / {
 proxy_pass http://127.0.0.1:8080;
 proxy_set_header Host $host;
 proxy_set_header X-Forward-For $remote_addr;
 }
 }

Please ask, what’s going on and how should it be modified?

Thank you!

Try adding

location / {
 ....
 proxy_redirect / /;
 }