Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
wordpress home url redirects to localhost

I'm using Wordpress + mysql + phpmyadmin with docker-compose and a reverse proxy with nginx in the host machine to send all requests to the wordpress container. After the wordpress installation I've set "site_url" and "home" option names to "http://example.com". Everything works fine when I'm browsing http://example.com/wp-admin but when I try with http://example.com it redirects me to localhost. Everything is in a remote server and I'm doing these requests from my browser and not from the server itself. This is my nginx conf:

server {
        listen                      80;
        listen                      [::]:80;
        server_name                 example.com
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        location / {
            proxy_pass http://localhost:8000;
        }
    }

and this is the docker-compose file:

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - /home/wordpress/mysqldb:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: rootpass
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpresspass

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       -  /home/wordpress/wordpress/html:/var/www/html
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpresspass
       WORDPRESS_DB_NAME: wordpress

   phpmyadmin:
     depends_on:
       - db
     image: phpmyadmin/phpmyadmin
     restart: always
     ports:
       - '8080:80'
     environment:
       PMA_HOST: db
       MYSQL_ROOT_PASSWORD: rootpass

If I set the option name with ServerIp:8000 the address http://example.com works but everything else redirects with the ServerIp and I'd like to use the domain name. Am I missing something with the wordpress options?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem was a simple syntax error. I used the command “service nginx restart” to restart and use a new nginx configuration but restart doesn’t show errors and falls back quietly to an old config. A simple ‘;’ was missing from the server name.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda