Nginx Reverse Proxy to LAMP server phpmyadmin access

Hi all.

I have been looking for this answer but I have not been able to do so.

I have a server with Nginx as a reverse proxy and want it to redirect my
http://domain.com/phpmyadmin to a different LAMP server which host
phpmyadmin.

Somehow my configuracion is not working:

server {
listen 80;
server_name DOMAIN.COM;

location / {
proxy_pass http://LAMP;
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 /phpmyadmin {
proxy_pass http://LAMP/phpmyadmin;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Can anybody please guide me?

Thank you in advance.

Posted at Nginx Forum:

Dear all …

The above configuration (first part only needed)… was correct

This one:

server {
listen 80;
server_name DOMAIN.COM;

location / {
proxy_pass http://LAMP;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Just was a mistake with my DNS.

Thanks!

Posted at Nginx Forum: