Page 3 of 3

Re: [GUIDE] How to replace phpMyAdmin by Adminer in Ubuntu 16.04 NGINX php-fpm

Posted: Sat Apr 18, 2020 2:50 pm
by gregorio
Any idea on how to force adminer to work only on HTTPS?

Re: [GUIDE] How to replace phpMyAdmin by Adminer in Ubuntu 16.04 NGINX php-fpm

Posted: Sat Apr 18, 2020 2:59 pm
by Spheerys
I'm also interested !
I thought a simple .htaccess like this :

Code: Select all

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTPS} off [OR]
  RewriteCond %{HTTP_HOST} ^www\.
  RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
  RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R=301]
</IfModule>
... on /usr/share/phpmyadmin/ (because I didn't changed the original path) should do the work, but no...

Re: [GUIDE] How to replace phpMyAdmin by Adminer in Ubuntu 16.04 NGINX php-fpm

Posted: Fri May 22, 2020 7:58 pm
by gregorio
.htaccess doens't work because the webserver that serves adminer is nginx.

I've found another way, you have modify the file:

Code: Select all

/etc/nginx/conf.d/phpmyadmin.inc
Adding these lines at line #3:

Code: Select all

    if ($server_port = 80) {
        rewrite ^ https://$host$request_uri permanent;
    }
Then restart the webserver.