Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
webprogrammierer opened this issue Feb 12, 2023 · 5 comments

Comments

@webprogrammierer
Copy link

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
Copy link
Member

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

@webprogrammierer
Copy link
Author

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
Copy link
Member

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

@webprogrammierer
Copy link
Author

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

@webprogrammierer
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants