-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
add FallbackResource alternative for assets/bundles in nginx #12125
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
Conversation
Thank you for your contribution, sadly I never used this before, so we need to find someone who can verify this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a nice proposal, I see no "no" for it, and I'm already using it in production 👍
# which will allow nginx to return a 404 error when files are | ||
# not found instead of passing the request to Symfony | ||
location /bundles { | ||
try_files $uri $uri/ =404; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if you are looking for a file, the $uri/
lookup seems useless to me.
try_files $uri /index.php$is_args$args; | ||
} | ||
# optionally disable falling back to php script for the asset directories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# optionally disable falling back to php script for the asset directories | |
# optionally disable falling back to PHP script for the asset directories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does it say "optionally" if it's enabled by default? I also don't really see the value of adding it. It only prevents use-cases like having a route starting with /bundles.
I don't see a downside for adding this, though you might want to add more info as to why you would want this and what are the downsides? ie.
|
bcc341a
to
8958f6c
Compare
…ginx (fliespl) This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #12125). Discussion ---------- add FallbackResource alternative for assets/bundles in nginx As described above - this location rule provides similar functionality to apache FallbackResource example. Commits ------- 8958f6c add FallbackResource alternative for assets/bundles in nginx
Thank you all for the review! I've merged but made some changes to comment this by default (as @Tobion asked), remove the unneeded |
As described above - this location rule provides similar functionality to apache FallbackResource example.