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

263
Vistas
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 Respuestas
Responde la pregunta

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 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