Took forever to figure out what the problem was to begin with - hoping there is a fix!
Using update.php as admin user 1 does not work when Drupal is run through a reverse proxy when you set:
- $settings['reverse_proxy_addresses'] = array(a.b.c.d', ...);
While having to have this set:
- $settings['reverse_proxy'] = TRUE; (with the above array set to the reverse proxy IP so a users correct IP can be obtained, for logging and or blocking)
With the above set, I receive the following default message:
- In order to run update.php you need to either be logged in as admin or have set $settings['update_free_access'] in your settings.php.
YES if I set update_free_access to TRUE it will work, but that is a step I would like to not make! Nor should I have to...
If I comment out reverse_proxy_address, it no longer sees the IP address I am accessing the site from, and defaults to the reverse proxy IP BUT logged in as admin user 1 update.php works as expected (WITHOUT setting update_free_access to TRUE)
I have searched everywhere for several weeks, thinking this was permissions problem or a setup problem to no avail. As I wasn't sure of the problem till now. Because I'm using Docker on a CentOS Google Compute Instance, using a reverse-proxy nginx container with lets encrypt so each Drupal web container I spin up (using Drupal/Docker as the base for the images, with minor customization's) Essentially each Drupal web container is php 7 apache debian (as is defined by drupal/docker) but each domain is handled thru the reverse-proxy nginx container so it all works nice and smooth - at least for me moving away from dedicated cPanel servers.
Anyway, the problem can be reproduced and duplicated..
Across 7 different Drupal 8 sites on the same reverse proxy network - they are all doing the same thing..
- So I either deal with having to change the update_free_access or don't get proper IP's - frustrating
YES - I can use drush, however I work with other admins who need to be able to use update.php through a web browser that are not technical enough to use command line.
If I knew where to begin on trying to create a patch, but this is outside the scope of knowledge with drupal (as I'm just getting into drupal 8, coming from years and years and years of 7.
Hoping someone can either point me in the right direction to a solution or supply a fix for this issue, as I cannot find anything anywhere that even seams to relate.
Thx - sidgrafix