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
chore(nginx): improve try_files, fix rewrites, increase file cache #3233
Conversation
a9aaa5e is currently deployed |
deployed e4cf44f |
deployed f479bfd |
open_file_cache_valid 120s; | ||
open_file_cache_min_uses 2; | ||
open_file_cache_errors off; | ||
|
||
error_page 404 @localized_404; | ||
set $lang en; |
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.
Very minor nitpick, can this be moved down to be directly above the error_page directive, as they're related?
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.
I feel like I rather keeping this at the top, as it could be used in other places, and I'm afraid if it's right after there it will override the one from @english_fallback
location @english_fallback { | ||
# Store the original language of the request | ||
# We'll use this for the 404 in the try_files in @localized_404 | ||
if ($uri ~* ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/) { | ||
set $lang $1; | ||
} | ||
|
||
rewrite ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/(.*)$ /en/$2; | ||
rewrite ^/(ar|be|ca|de|es|fa|fr|gl|id|it|ja|ka|ko|nl|pt-br|ro|ru|tr|uk|zh-cn|zh-tw)/(.*)$ /en/$2 last; |
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.
Is this change actually needed now?
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.
It is verbose, but kinda goes with the behaviour we want to follow. Not really needed, but I feel like it's better to be explicit.
2513fe6 is deployed on both servers (live and fallback). |
This PR updates the cache_file cache to
100000
, fixes rewrites by removing their/
trailing slash, and remove unnecessarytry_files
from known failing conditions.