forked from cloudbase/garm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-server.conf
38 lines (31 loc) · 896 Bytes
/
nginx-server.conf
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
upstream garm_backend {
server 192.168.122.100:9997 weight=5;
}
server {
server_name garm.example.com;
location /api/v1/ws {
proxy_pass http://garm_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $http_host;
proxy_pass http://garm_backend;
proxy_set_header Host $Host;
proxy_redirect off;
}
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
}
server {
if ($host = garm.example.com) {
return 301 https://$host$request_uri;
}
server_name garm.example.com;
listen 80;
return 404;
}