title: phpMyAdmin inside docker container via nginx reverse proxy
body: <p>I installed <a href="https://hub.docker.com/r/phpmyadmin/phpmyadmin/" rel="noreferrer">phpMyAdmin docker image</a> and run it with</p>
  
  <pre><code># docker run --name phpmyadmin -d --link mariadb:db -p 8081:80 -e PMA_ABSOLUTE_URI=http://servm3/pma --restart unless-stopped phpmyadmin/phpmyadmin
  </code></pre>
  
  <p>Accessing <a href="http://servm3:8081" rel="noreferrer">http://servm3:8081</a> works fine. The variable PMA_ABSOLUTE_URI is for reverse proxies as seen on the <a href="https://hub.docker.com/r/phpmyadmin/phpmyadmin/" rel="noreferrer">docker page</a>.</p>
  
  <p>Then I set up nginx (locally installed, not inside docker) to act as a reverse proxy (working for several other apps like guacamole).</p>
  
  <p>Inside my nginx.conf I have:</p>
  
  <pre><code>location /pma/ {               
      proxy_pass http://localhost:8081/;                                 
      proxy_buffering off;                                     
  }
  </code></pre>
  
  <p>Accessing <a href="http://servm3/pma" rel="noreferrer">http://servm3/pma</a> shows the favicon on the browser tab but instead of the login page only a blank page is shown. Removing the preceding "/" and restarting nginx only gives a 404.</p>
  
  <pre><code># docker logs phpmyadmin
  </code></pre>
  
  <p>shows nothing except from the php and nginx service start info, nothing related to phpmyadmin.</p>
  
  <p>Local nginx access log shows several 304 and 404 codes and some 200, error log is not present. Detailled log can be found <a href="https://pastebin.com/MmMT02if" rel="noreferrer">here on pastebin</a>.</p>
  
  <p>I hope somebody will be able to tell me how to make nginx work as a reverse proxy for the phpMyAdmin docker container.</p>
  
  <p>If some important information is missing please let me know.</p>