mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
refactor: move proxy to monorepo
This commit is contained in:
40
backend/proxy/fixtures/staticRoute.template
Normal file
40
backend/proxy/fixtures/staticRoute.template
Normal file
@@ -0,0 +1,40 @@
|
||||
location /_static/ {
|
||||
|
||||
# use our custom request limit and allow bursts
|
||||
limit_req zone=customstappslimit burst=20 nodelay;
|
||||
|
||||
{{{ cors }}}
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
{{{ cors }}}
|
||||
add_header 'Content-Length' '0';
|
||||
return 204;
|
||||
}
|
||||
alias /static/;
|
||||
expires 7d;
|
||||
## Check for file existing and if there, stop ##
|
||||
if (-f $request_filename) {
|
||||
break;
|
||||
}
|
||||
## Check for file existing and if there, stop ##
|
||||
if (-d $request_filename) {
|
||||
break;
|
||||
}
|
||||
##Check for png
|
||||
if (-e $request_filename.png) {
|
||||
rewrite ^/(.*)$ /$1.png;
|
||||
break;
|
||||
}
|
||||
##Check for gif
|
||||
if (-e $request_filename.gif) {
|
||||
rewrite ^/(.*)$ /$1.gif;
|
||||
break;
|
||||
}
|
||||
##Check for jpg
|
||||
if (-e $request_filename.jpg) {
|
||||
rewrite ^/(.*)$ /$1.jpg;
|
||||
break;
|
||||
}
|
||||
##Fallback rule if no match is found
|
||||
rewrite ^/(.*/).*(small|medium|large|thumbnail)$ /$1default-$2.png;
|
||||
}
|
||||
Reference in New Issue
Block a user