docker4drupal icon indicating copy to clipboard operation
docker4drupal copied to clipboard

How to change NGINX_VHOST_PRESET and allow viewing some specific files in browser

Open webprogrammierer opened this issue 2 years ago • 5 comments

In some Drupal 9 projects I want to be able to view specific custom php files in the browser, e.g. http://myproject.test/mycustomscript.php http://myproject.test/myscripts/testscript1.php http://drupal.docker.localhost:8000/myscripts/testscript2.php http://drupal.docker.localhost:8000/testpage.html

using Docker Desktop on Windows 10.

How can I change the NGINX_VHOST_PRESET or how can I add the specific files to be able to call/view these files in browser?

Without change I can not open these script files in browser, the NGINX_VHOST_PRESET blocks them. Thank you.

webprogrammierer avatar Feb 12 '23 11:02 webprogrammierer

you can try setting NGINX_VHOST_PRESET=php to use a generic php preset, or

csandanov avatar Feb 15 '23 08:02 csandanov

you can try setting NGINX_VHOST_PRESET=php to use a generic php preset, or

or?

Maybe this works but I want to allow specific files as you can see in my question above.

webprogrammierer avatar Feb 20 '23 18:02 webprogrammierer

or you can use $NGINX_CONF_INCLUDE to override the virtual host config

csandanov avatar Feb 28 '23 06:02 csandanov

How does this work? Need an example. Thank you.

webprogrammierer avatar Feb 28 '23 17:02 webprogrammierer

If I set NGINX_VHOST_PRESET=php a lot of drupal routes do not work anymore, for example /sitemap.xml (using the xmlsitemap module).

Therefore still searching for an solution!

webprogrammierer avatar May 20 '23 18:05 webprogrammierer