Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda