# How can I have phpmyadmin under my Nginx reverse proxy ?

**URL:** https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456
**Category:** Troubleshooting
**Created:** [23 March 2022 15:26 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456 "2022-03-23T15:26:50Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)
#### Post date: [23 March 2022 15:26 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/1 "2022-03-23T15:26:50Z")

</div>

Hi,

I already have an nginx reverse proxy that I use for all kind of services. Now I need to add MariaDB and phpmyadmin to my services. According to the docs, the base phpmyadmin path is

```nohighlight
http://<your.IP>/phpmyadmin

```

. But I can’t manage to add it to my reverse proxy. I tried this :

```nohighlight
location /phpmyadmin/ {
    proxy_pass http://localhost:80/phpmyadmin/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection keep-alive;
    proxy_cache_bypass $http_upgrade;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $http_host;
}

```

But it doesn’t seem to be working, I have a 404 error.  
Looking a bit further, it appears phpmyadmin is using its own apache2 server, that got installed at the same time. I guess this couldn’t work because apache and nginx are both trying to use the same port. So my question is :

Should I make phpmyadmin run on nginx instead of apache ? If yes, how ?  
If no, is it possible to make a reverse proxy in my nginx config to phpmyadmin’s apache ? How ?

Thanks in advance for any answer, have a great day

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [23 March 2022 16:14 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/2 "2022-03-23T16:14:54Z")

</div>

There shouldn’t be any need to do a proxy configuration. Phpmyadmin is a web server application and should be already reachable via Nginx by default.

Nginx is running on port 80/443 and doing your proxy configuration will end up in a loop pointing to Nginx itself.

---

<div class="post-metadata">

### Author: ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)
#### Post date: [27 March 2022 18:44 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/3 "2022-03-27T18:44:36Z")

</div>

> [@](#):
>
> There shouldn’t be any need to do a proxy configuration. Phpmyadmin is a web server application and should be already reachable via Nginx by default.
> 
> Nginx is running on port 80/443 and doing your proxy configuration will end up in a loop pointing to Nginx itself.

I forgot to say that my goal is to make phpmyadmin accessible from the outside of my network. That’s why I’m looking to set it behind my nginx reverse proxy. But it doesn’t seem to work, maybe because by default phpmyadmin is on port 80 and not another port.

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [27 March 2022 19:30 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/4 "2022-03-27T19:30:17Z")

</div>

I guess than you just have to portforward port 80 in your router and you’re good to go, unless you run more than one webserver on different devices in your LAN, which should be accessible from the internet.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [28 March 2022 09:34 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/5 "2022-03-28T09:34:48Z")

</div>

I guess there is a misunderstanding still. phpmyadmin is not an own application. It is nothing else than a web site hosted by a web server. I you case, it should be Nginx you use already as revers proxy. Therefore, of course it is running on port 80, as Nginx is running on port 80. That’s the reason why no revers proxy should be needed as phpmyadmin web site should be reachable already.

---

<div class="post-metadata">

### Author: ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)
#### Post date: [28 March 2022 19:56 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/6 "2022-03-28T19:56:14Z")

</div>

> [@](#):
>
> I guess than you just have to portforward port 80 in your router and you’re good to go, unless you run more than one webserver on different devices in your LAN, which should be accessible from the internet.

Unfortunately, that’s the case. I already have an Nginx server on my port 80.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [28 March 2022 20:06 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/7 "2022-03-28T20:06:14Z")

</div>

And exactly this Nginx is already serving your phpmyadmin. There is no other web server. Phpmyadmin is a web server based app and is provided by your Nginx.

---

<div class="post-metadata">

### Author: ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)
#### Post date: [29 March 2022 21:04 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/8 "2022-03-29T21:04:48Z")

</div>

> [@](#):
>
> And exactly this Nginx is already serving your phpmyadmin. There is no other web server. Phpmyadmin is a web server based app and is provided by your Nginx.

I am having a “404 error not found” when I try to access phpmyadmin on my domain. I checked that phpmyadmin and mariadb are properly installed. The services are up and running.

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [29 March 2022 22:52 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/9 "2022-03-29T22:52:36Z")

</div>

Can you reach it with the local IP of the device?  
Do you can reach other stuff you habe running on that server (if you have other)?

---

<div class="post-metadata">

### Author: ![LeVraiRoiDHyrule](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/e9bcb4/32.png) [@LeVraiRoiDHyrule](https://dietpi.com/forum/u/LeVraiRoiDHyrule)
#### Post date: [30 March 2022 10:00 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/10 "2022-03-30T10:00:50Z")

</div>

> [@](#):
>
> Can you reach it with the local IP of the device?  
> Do you can reach other stuff you habe running on that server (if you have other)?

I am currently not on the same network as the pi and won’t be able to access it for a few months.  
Yes, I have a lot of other stuff running on it and everything is perfectly accessible.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [31 March 2022 15:33 UTC](https://dietpi.com/forum/t/how-can-i-have-phpmyadmin-under-my-nginx-reverse-proxy/6456/11 "2022-03-31T15:33:53Z")

</div>

you are using a plain Nginx or something like Nginx Proxy Manager? Your web server root is still /var/www? Can you share your proxy configuration files and web server config files? You could remove or overwrite domain information.
