[Evergreen-dev] Staff client files may be served directly from NGINX, etc.
Bill Erickson
berickxx at gmail.com
Tue Feb 18 11:36:18 EST 2025
Hi All,
I can't remember if this has been discussed before, but the eg2 staff
client files are all static files that can be served via NGINX or your
proxy of choice.
Given how chunky the Evergreen Apache processes are, I set this up a while
back to reduce the amount of traffic hitting Apache. With bots running
amok, I thought I'd share.
Here's my NGINX setup to serve eg2 files. Change "expires" values to suit.
location /eg2/staff/ {
# If no locale is selected, redirect to en-US
rewrite ^/eg2/staff/(.*) /eg2/en-US/staff/$1 redirect;
}
location /eg2/en-US/ {
# If an unknown file is requested, serve the index file.
# This is SOP for Angular, where all paths emit from the index.
try_files $uri /eg2/en-US/index.html;
}
location /eg2/en-US/index.html {
# Expire the index file daily to pull new builds.
# No need to expire other eg2 files since they have
# cache-busting hashes.
expires 10m;
}
location ~ /eg2/en-US/[0-9a-z\.-_]+.(js|css)$ {
# These Angular files have cache-busting hashes in the
# file name. Give them a decently long expire time.
expires 30d;
}
Hope it helps,
-b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-dev/attachments/20250218/d2680551/attachment.htm>
More information about the Evergreen-dev
mailing list