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

  docker, question

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

Problem description:

Direct access, 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 ;
 location / {
 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 / /;