-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnginx.conf.example
More file actions
79 lines (68 loc) · 2.73 KB
/
Copy pathnginx.conf.example
File metadata and controls
79 lines (68 loc) · 2.73 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Example host-level reverse-proxy config for printstream. This sits in
# front of the app stack and forwards the public origin to the `api`
# container, which serves the web SPA together with `/api` and `/ws` on one
# port (4000). There is no separate web container.
#
# Replace `printstream.example.com` with your server's domain, and
# `printstream-api` with your api service's container name. The real
# `nginx.conf` stays local/server-specific and is ignored by git.
server {
server_name printstream.example.com;
listen 80;
return 308 https://$host$request_uri;
}
server {
server_name printstream.example.com;
listen 443 ssl http2;
ssl_certificate /letsencrypt/live/printstream.example.com/fullchain.pem;
ssl_certificate_key /letsencrypt/live/printstream.example.com/privkey.pem;
resolver 127.0.0.11 valid=30s;
proxy_buffering off;
# Match the API's default 1 GB upload ceiling so large 3MF uploads
# do not fail at the reverse proxy before multer can enforce its own limit.
client_max_body_size 1g;
location = /api/bridge-runtime/connect {
set $upstream printstream-api;
proxy_pass http://$upstream:4000;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1h;
proxy_send_timeout 1h;
proxy_redirect off;
}
location /ws {
set $upstream printstream-api;
proxy_pass http://$upstream:4000;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1h;
proxy_send_timeout 1h;
proxy_redirect off;
}
location / {
set $upstream printstream-api;
proxy_pass http://$upstream:4000;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_redirect off;
}
}