This repository was archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdefault.conf
76 lines (63 loc) · 2.73 KB
/
default.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
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
# This is a basic, default Nginx file to work with the LetsEncrypt and Organizr v2 Docker containers. LetsEncrypt will be your main
# Nginx Web Server and that is where all config changes should be made.
# Redirect all traffic to https
server {
listen 80;
listen [::]:80;
server_name _; # This will respond to any domain/subdomain that isn't specified in another config
return 301 https://$host$request_uri;
}
# Main server block
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
index index.html index.htm index.php;
server_name _; # This will respond to any domain/subdomain that isn't specified in another config
# Enable subfolder method reverse proxy confs
include /config/nginx/proxy-confs/*.subfolder.conf;
# All ssl related config moved to ssl.conf
include /config/nginx/ssl.conf;
# Custom Org v2 error pages
error_page 400 403 404 405 408 500 502 503 504 =200 /?error=$status;
error_page 401 =200 /?error=$status&return=$request_uri;
# Proxy origin IP
proxy_bind $server_addr;
# Org v2 Server Auth
location ~ /auth-([0-9]+) {
internal;
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
# Change organizr to the correct container name or to the corresponding IP
set $upstream_organizr organizr;
proxy_pass http://$upstream_organizr:80/api/?v1/auth&group=$1;
proxy_set_header Content-Length "";
# Do not uncomment the lines below, these are examples for usue in other proxy configs
#auth_request /auth-0; #=Admin
#auth_request /auth-1; #=Co-Admin
#auth_request /auth-2; #=Super User
#auth_request /auth-3; #=Power User
#auth_request /auth-4; #=User
#auth_request /auth-998; #=Logged In
#auth_request /auth-999; #=Guest
}
# Deny access to all .ht files
location ~ /\.ht {
deny all;
}
# Deny access to Org Dashboard files
location ~ /org.db|organizrLog.json|organizrLoginLog.json {
deny all;
}
# Home location block (Organizr v2)
location / {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
# Change organizr to the correct container name or to the corresponding IP
set $upstream_organizr organizr;
proxy_pass http://$upstream_organizr:80;
}
}
# Enable subdomain method reverse proxy confs
include /config/nginx/proxy-confs/*.subdomain.conf;
# enable proxy cache for auth
proxy_cache_path cache/ keys_zone=auth_cache:10m;