-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-example.txt
87 lines (75 loc) · 2.18 KB
/
nginx-example.txt
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
80
81
82
83
84
85
86
server {
listen 80;
listen [::]:80;
server_name www.testmerrie.nl testmerrie.nl;
root /var/www/testmerrie;
location /.well-known {
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name www.testmerrie.nl testmerrie.nl;
ssl_certificate /etc/letsencrypt/live/testmerrie.nl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/testmerrie.nl/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
location = /auth-request {
internal;
if ($request_uri ~* "[^\?]+\?(.*)$") {
set $args $1;
}
rewrite ^.* /api/auth-check last;
}
location ^~ /api/ {
add_header Access-Control-Allow-Origin *;
rewrite ^/api/(.*) /$1 break;
include uwsgi_params;
uwsgi_pass_header Authorization;
uwsgi_pass_request_headers on;
uwsgi_pass unix:/run/testmerrie-api/uwsgi.sock;
}
location ^~ /ome/ {
auth_request /auth-request;
proxy_pass http://localhost:3333/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_connect_timeout 24h;
proxy_send_timeout 24h;
proxy_read_timeout 24h;
# HLS: can't have auth (has OME session token anyway), but don't allow websocket
location ~ ^.*/(chunklist|init|part|seg)_[^/]* {
auth_request "off";
rewrite ^/ome/(.*) /$1 break;
proxy_pass http://localhost:3333;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
location ^~ /time {
auth_basic off;
proxy_pass http://localhost:8691/time$is_args$args;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_connect_timeout 24h;
proxy_send_timeout 24h;
proxy_read_timeout 24h;
}
location / {
root /var/www/testmerrie;
index index.html;
try_files $uri /index.html;
}
}