2015-02-06 17:01:50 +00:00
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name _; # Catch all, see http://nginx.org/en/docs/http/server_names.html
|
|
|
|
|
2022-02-01 16:39:55 +00:00
|
|
|
root /overleaf/services/web/public/;
|
2015-02-06 17:01:50 +00:00
|
|
|
|
2023-06-06 12:04:57 +00:00
|
|
|
# block external access to prometheus /metrics
|
|
|
|
location /metrics {
|
|
|
|
internal;
|
|
|
|
}
|
|
|
|
|
2015-02-06 17:01:50 +00:00
|
|
|
location / {
|
2024-04-03 10:17:13 +00:00
|
|
|
proxy_pass http://127.0.0.1:4000;
|
2015-02-06 17:01:50 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
2021-06-24 15:12:46 +00:00
|
|
|
proxy_set_header Host $host;
|
2015-02-06 17:01:50 +00:00
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
2020-10-22 16:24:40 +00:00
|
|
|
proxy_read_timeout 10m;
|
|
|
|
proxy_send_timeout 10m;
|
2015-02-06 17:01:50 +00:00
|
|
|
}
|
2020-02-13 10:59:20 +00:00
|
|
|
|
2015-02-06 17:01:50 +00:00
|
|
|
location /socket.io {
|
2024-04-03 10:17:13 +00:00
|
|
|
proxy_pass http://127.0.0.1:3026;
|
2015-02-06 17:01:50 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
2021-06-24 15:12:46 +00:00
|
|
|
proxy_set_header Host $host;
|
2015-02-06 17:01:50 +00:00
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
2020-10-22 16:24:40 +00:00
|
|
|
proxy_read_timeout 10m;
|
|
|
|
proxy_send_timeout 10m;
|
2015-02-06 17:01:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
location /stylesheets {
|
|
|
|
expires 1y;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /minjs {
|
|
|
|
expires 1y;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /img {
|
|
|
|
expires 1y;
|
|
|
|
}
|
2022-10-17 10:13:53 +00:00
|
|
|
|
|
|
|
# handle output files for specific users
|
|
|
|
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
|
2024-04-03 10:17:13 +00:00
|
|
|
proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
|
2022-10-17 10:13:53 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
}
|
|
|
|
# handle output files for anonymous users
|
|
|
|
location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
|
2024-04-03 10:17:13 +00:00
|
|
|
proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
|
2022-10-17 10:13:53 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
}
|
|
|
|
# PDF range for specific users
|
|
|
|
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
|
2024-04-03 10:17:13 +00:00
|
|
|
proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
|
2022-10-17 10:13:53 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
}
|
|
|
|
# PDF range for anonymous users
|
|
|
|
location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
|
2024-04-03 10:17:13 +00:00
|
|
|
proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
|
2022-10-17 10:13:53 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
}
|
2023-04-04 12:14:49 +00:00
|
|
|
|
|
|
|
# Load any extra configuration for this vhost
|
2024-02-09 15:52:24 +00:00
|
|
|
include /etc/nginx/vhost-extras/overleaf/*.conf;
|
2015-02-06 17:01:50 +00:00
|
|
|
}
|