wodby / docker4drupal

Docker-based Drupal stack
https://wodby.com/docker4drupal
MIT License
1.24k stars 535 forks source link

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

Open webprogrammierer opened 1 year ago

webprogrammierer commented 1 year ago

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.

csandanov commented 1 year ago

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

webprogrammierer commented 1 year ago

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.

csandanov commented 1 year ago

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

webprogrammierer commented 1 year ago

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

webprogrammierer commented 1 year ago

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!