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
website-specific custom nginx best practices? #367
Comments
The way this is done in Valet is using custom drivers: https://laravel.com/docs/5.4/valet#custom-valet-drivers Valet uses one nginx config for the whole environment, all of the actual rewrite rules for a project exist in PHP. Here's the rules for a Laravel project for example: https://github.com/laravel/valet/blob/master/cli/drivers/LaravelValetDriver.php |
alright.. that's a bit confusing how to translate nginx rewrite rules to php but I think I'll figure it out by looking at the other drivers but what if i want to apply specific CORS settings for a site? I have to apply it to ALL sites? |
If you want to manage all your nginx configuration and stuff yourself you are better off just using nginx directly, you won't really be getting any benefit from using Valet at all. Usually CORS settings are done in code at the app level, not at the server configuration level. |
Just wondering if this approach ever changed, or was updated or augmented since 2017? Like @vesper8 I also think it would be sooo helpful to just have a _nginx.conf some place easily accessible in these cases where an application requires a specific tweak. |
Absolutely, be nice to test things like error page redirects or post max data sizes per site locally within valet! |
I'm switching from Homestead to Valet and mostly it's been very smooth but running into a few issues. I have a few sites I'm working on that require custom nginx.
One requires this block (Invision Board Forum)
Another requires these (to possibly replace existing location / block)
and yet another requires this inside the location ~ .php$ block
With Homestead I simply had a little script that would be triggered by the after.sh which just took my custom nginx configurations and overwrote whatever ones the homestead provisioning script had created
With Valet I'm not at all sure how to go about doing this as it's not clear how nginx is involved.. I don't see unique nginx vhost files created for all my linked domains
Would really appreciate some guidance!
The text was updated successfully, but these errors were encountered: