Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx reverse proxy to phpmyadmin is not working #210

Closed
SubrataM3 opened this issue Feb 18, 2019 · 5 comments
Closed

Nginx reverse proxy to phpmyadmin is not working #210

SubrataM3 opened this issue Feb 18, 2019 · 5 comments

Comments

@SubrataM3
Copy link

SubrataM3 commented Feb 18, 2019

Docker Image version:
4.8.5 (using the latest tag)

Nginx configuration:
Using the same configuration that is supposed to work as per the comments of other users here.

location /phpmyadmin {
                proxy_pass http://phpmyadmin/;
                proxy_redirect off;
                proxy_set_header Host $host;
}

Docker-compose
I have set correct environment variable using the following URL
- PMA_ABSOLUTE_URI=https://sub.domain_name.com/phpmyadmin/

Issues

  1. The page is not loading correctly (Please check attached image) (latest version)
    shot_190219_014516
  2. Whenever the env variable is set in docker-compose I get following warning.

There is a mismatch between HTTPS indicated on the server and client. This can lead to non-working phpMyAdmin or a security risk. Please fix your server configuration to indicate HTTPS properly.

I am sure the PMA_ABSOLUTE_URI is correctly set.

  1. After submitting login I get 404 Not Found.

  2. I have also tried earlier versions like 4.7 and 4.6. Those were just returning a blank page, you can see failed elements in the following screenshot.
    image

Kindly help me with this issue. You can also send instructions to debug this.
Thank you.

@ChrislyBear-GH
Copy link

Same.

@SubrataM3
Copy link
Author

Hi,

I have actually got this issue fixed. I can explain what was happening.

Here is my updated & working configuration.

location ~ ^/phpmyadmin/ {
	rewrite ^/phpmyadmin(/.*)$ $1 break;
    proxy_pass http://phpmyadmin;
}

Issue 1 :
Nginx selects "location block with regex" before "location with just prefix path". I had another location block like the following which was basically capturing all other php file request.

location ~ [^/].php(/|$)
As you can see (Image of Issue 1) only PHP files were failing to load which was actually getting captured by the general php location block.

Issue 2: This was happening because of PHP files were failing to load.

I hope this helps others.

@tenshiAMD
Copy link

@SubrataM3 can you share to us your config file? Thanks in advance.

@SubrataM3
Copy link
Author

@SubrataM3 can you share to us your config file? Thanks in advance.

I think already shared my config on the above post? which config you are talking about?

@chendelin1982
Copy link

I use below and can access

  location /phpmyadmin/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_set_header X-Real-IP		$remote_addr;
    proxy_pass       http://phpmyadmin:80;
    rewrite ^/phpmyadmin(/.*)$ $1 break;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants