-
Notifications
You must be signed in to change notification settings - Fork 7
/
essi-nginx.nginx
49 lines (39 loc) · 1.29 KB
/
essi-nginx.nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
upstream essi_app {
server essi:3000;
}
upstream essi_iiif {
server cantaloupe:8182;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
client_max_body_size 200M;
listen 3000 ssl;
ssl_certificate /etc/nginx/certs/localhost.crt;
ssl_certificate_key /etc/nginx/certs/localhost.key;
ssl_session_cache shared:SSL:5m;
ssl_session_timeout 1h;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# Fix the "It appears that your reverse proxy set up is broken" error.
proxy_pass http://essi_app;
proxy_read_timeout 90;
proxy_redirect http://essi_app /;
}
location ~ /iiif/(2|3) {
proxy_pass http://essi_iiif;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Path /;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect http://essi_iiif:8182/ /iiif/$1;
}
}