mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
[monorepo] switch all output file reads to clsi-nginx (#31691)
* [monorepo] switch all output file reads to clsi-nginx * [clsi-lb] allow gallery download requests * [terraform] clsi: use nginx.conf from clsi service * [clsi] fix flakey tests * [clsi] replace alias with rewrite and root in nginx config * [k8s] clsi-lb: expose download port on internal service * [web] add explicit endpoint for downloading all output files Serve the output.zip endpoint from clsi. * [clsi] fix regex for latexqc submission ids Previously, we only handled template submission ids. GitOrigin-RevId: 6c3b21b01ec41ae767530b14aac31fbe3d640dd5
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
# keep in sync with clsi-startup.sh files
|
||||
# keep in sync with clsi/nginx.conf
|
||||
# keep in sync with services/clsi/nginx.conf
|
||||
# Changes to the above:
|
||||
# - added debug header
|
||||
# - added Security-Headers
|
||||
# - remove CORS rules, Server-CE/Server-Pro runs behind a single origin
|
||||
# - change /output path to /var/lib/overleaf/data/output
|
||||
# - remove tiny.pdf endpoints
|
||||
|
||||
server {
|
||||
# Extra header for debugging.
|
||||
add_header 'X-Served-By' 'clsi-nginx' always;
|
||||
|
||||
# Security-Headers
|
||||
@@ -30,20 +29,14 @@ server {
|
||||
application/pdf pdf;
|
||||
}
|
||||
# handle output files for specific users
|
||||
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z.]+)$ {
|
||||
alias /var/lib/overleaf/data/output/$1-$2/generated-files/$3/output.$4;
|
||||
}
|
||||
# handle .blg files for specific users
|
||||
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/(.+)\.blg$ {
|
||||
alias /var/lib/overleaf/data/output/$1-$2/generated-files/$3/$4.blg;
|
||||
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/(.+)$ {
|
||||
rewrite ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/(.+)$ /$4 break;
|
||||
root /var/lib/overleaf/data/output/$1-$2/generated-files/$3/;
|
||||
}
|
||||
# handle output files for anonymous users
|
||||
location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z.]+)$ {
|
||||
alias /var/lib/overleaf/data/output/$1/generated-files/$2/output.$3;
|
||||
}
|
||||
# handle .blg files for anonymous users
|
||||
location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/(.+)\.blg$ {
|
||||
alias /var/lib/overleaf/data/output/$1/generated-files/$2/$3.blg;
|
||||
location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/(.+)$ {
|
||||
rewrite ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/(.+)$ /$3 break;
|
||||
root /var/lib/overleaf/data/output/$1/generated-files/$2/;
|
||||
}
|
||||
|
||||
# PDF range for specific users
|
||||
@@ -58,4 +51,9 @@ server {
|
||||
expires 1d;
|
||||
alias /var/lib/overleaf/data/output/$1/content/$2;
|
||||
}
|
||||
|
||||
# Do not look up any non matching files in the default root.
|
||||
location / {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user