You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using nginx-drupal image, it is not possible to run update.php in the browser as it is not allowed in the nginx configuration. Whether it was done on purpose to enforce CLI-only updates, or represents a config defect - there are cases where update.php should run (specifically - writing tests for hook_update_N() that require update.php to be accessible from the browser).
After some time trying different methods of overriding location and looking into how update.php can be used as update.php/info, update.php/section etc., the working solution includes:
Creating location_prepend_update_php.conf with content:
would not pass fastcgi_split_path_info ^(.+?\.php)(|/.*)$; to the @php block.
I'm not sure about the best approach to extending @php block with fastcgi_split_path_info ^(.+?\.php)(|/.*)$; as it may have security implications.
I'm looking for a comment from the Lagoon team on this - is it a defect in the config and it should be fixed or if this is an intended "lock", in which case I'm wondering about the best approach to allow this on per-site basis while reusing @php block.
The text was updated successfully, but these errors were encountered:
AlexSkrypnyk
changed the title
Unable to run update.php from the browser (workaround included)
nginx-drupal: unable to run update.php from the browser (workaround included)
May 7, 2023
Using
nginx-drupal
image, it is not possible to runupdate.php
in the browser as it is not allowed in the nginx configuration. Whether it was done on purpose to enforce CLI-only updates, or represents a config defect - there are cases whereupdate.php
should run (specifically - writing tests forhook_update_N()
that requireupdate.php
to be accessible from the browser).After some time trying different methods of overriding
location
and looking into howupdate.php
can be used asupdate.php/info
,update.php/section
etc., the working solution includes:location_prepend_update_php.conf
with content:/etc/nginx/conf.d/drupal/
so the resulting file has a path of/etc/nginx/conf.d/drupal/location_prepend_update_php.conf
The above would work, however it does not re-use
@php
location block from thedrupal.conf
because using:would not pass
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
to the@php
block.I'm not sure about the best approach to extending
@php
block withfastcgi_split_path_info ^(.+?\.php)(|/.*)$;
as it may have security implications.I'm looking for a comment from the Lagoon team on this - is it a defect in the config and it should be fixed or if this is an intended "lock", in which case I'm wondering about the best approach to allow this on per-site basis while reusing
@php
block.The text was updated successfully, but these errors were encountered: