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

264
Visualizações
404 not found on phpmyadmin - nginx docker

I want to run phpmyadmin and my API on same domain using docker and nginx, as:

api => localhost:8888/ phpmyadmin => localhost:8888/phpmyadmin/

Docker config for phpmyadmin service:

phpmyadmin:
  image: phpmyadmin
  restart: always
  environment:
    PMA_ARBITRARY: 1
    PMA_HOST: mysql
    PMA_USER: ${DATABASE_USER}
    PMA_PASSWORD: ${DATABASE_PASSWORD}
  depends_on:
    - mysql

This is nginx service config:

nginx:
  image: nginx:stable-alpine
  volumes:
    - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
  depends_on:
    - api
    - phpmyadmin
  restart: always
  ports:
    - '8888:80'

And this is nginx config file:

upstream pma {
  server phpmyadmin;
}

server {
  listen 80;
  server_name localhost;
  # resolver 127.0.0.1;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass http://api:8889/;
    proxy_redirect off;
  }

  location ~/phpmyadmin(.*)$ {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;

    proxy_pass http://pma/$1/;
    proxy_redirect off;
  }
}

Everything works fine, I can use the API, as localhost:8888/url and it works fine. But when I request localhost:8888/phpmyadmin/, it loads it, but js and all css gives 404 not found, here's the console preview:

enter image description here

I have been scratching my head from more than 3 hours to fix this, tried my best, but it doesn't work. I am pretty much new to nginx so can anyone please help me out.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Did you try adding PMA_ABSOLUTE_URI in the docker phpmyadmin service environments? Checkout this:

PMA_ABSOLUTE_URI - the full URL to phpMyAdmin. Sometimes needed when used in a reverse-proxy configuration.

Add it like:

PMA_ABSOLUTE_URI: localhost:8888/phpmyadmin/

Please notice the last / that is very very important, if you miss it, it will not work.

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