mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 12:43:39 -05:00
6d98d6a7c0
[server-pro] remove ShareLaTeX branding from filesystem GitOrigin-RevId: c1d2c63bdc888d81e03bb1721e44b6ed6f64524b
61 lines
2.1 KiB
Text
61 lines
2.1 KiB
Text
# keep in sync with clsi-startup.sh files
|
|
# keep in sync with clsi/nginx.conf
|
|
# Changes to the above:
|
|
# - added debug header
|
|
# - remove CORS rules, Server-CE/Server-Pro runs behind a single origin
|
|
# - change /output path to /var/lib/overleaf/data/output
|
|
|
|
server {
|
|
# Extra header for debugging.
|
|
add_header 'X-Served-By' 'clsi-nginx' always;
|
|
|
|
# Security-Headers
|
|
add_header 'X-Content-Type-Options' 'nosniff' always;
|
|
add_header 'X-Download-Options' 'noopen' always;
|
|
add_header 'X-Frame-Options' 'SAMEORIGIN' always;
|
|
add_header 'X-XSS-Protection' '1; mode=block' always;
|
|
|
|
listen 8080;
|
|
server_name clsi-nginx;
|
|
server_tokens off;
|
|
access_log off;
|
|
# Ignore symlinks possibly created by users
|
|
disable_symlinks on;
|
|
# enable compression for tex auxiliary files, but not for pdf files
|
|
gzip on;
|
|
gzip_types text/plain;
|
|
gzip_proxied any;
|
|
types {
|
|
text/plain log blg aux stdout stderr;
|
|
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;
|
|
}
|
|
# 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;
|
|
}
|
|
|
|
# PDF range for specific users
|
|
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
|
|
# Cache for one day
|
|
expires 1d;
|
|
alias /var/lib/overleaf/data/output/$1-$2/content/$3;
|
|
}
|
|
# PDF range for anonymous users
|
|
location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
|
|
# Cache for one day
|
|
expires 1d;
|
|
alias /var/lib/overleaf/data/output/$1/content/$2;
|
|
}
|
|
}
|