|
1 | | -## Version 2022/03/19 |
2 | | -# Make sure that your dns has a cname set for dashboard |
| 1 | +## Version 2022/06/05 |
| 2 | +# make sure that your dns has a cname set for dashboard |
3 | 3 |
|
4 | 4 | server { |
5 | 5 | listen 81; |
6 | 6 |
|
7 | 7 | server_name _; |
8 | 8 |
|
9 | | - root /dashboard/www; |
10 | | - index index.php; |
| 9 | + root /dashboard/www; |
| 10 | + index index.php; |
11 | 11 |
|
12 | 12 | client_max_body_size 0; |
13 | 13 |
|
14 | | - # enable for ldap auth, fill in ldap details in ldap.conf |
15 | | - #include /config/nginx/ldap.conf; |
| 14 | + # enable for ldap auth (requires ldap-location.conf in the location block) |
| 15 | + #include /config/nginx/ldap-server.conf; |
16 | 16 |
|
17 | | - # enable for Authelia |
| 17 | + # enable for Authelia (requires authelia-location.conf in the location block) |
18 | 18 | #include /config/nginx/authelia-server.conf; |
19 | 19 |
|
| 20 | + # enable for Authentik (requires authentik-location.conf in the location block) |
| 21 | + #include /config/nginx/authentik-server.conf; |
| 22 | + |
20 | 23 | location / { |
21 | 24 | # enable the next two lines for http auth |
22 | 25 | #auth_basic "Restricted"; |
23 | 26 | #auth_basic_user_file /config/nginx/.htpasswd; |
24 | 27 |
|
25 | | - # enable the next two lines for ldap auth |
26 | | - #auth_request /auth; |
27 | | - #error_page 401 =200 /ldaplogin; |
| 28 | + # enable for ldap auth (requires ldap-server.conf in the server block) |
| 29 | + #include /config/nginx/ldap-location.conf; |
28 | 30 |
|
29 | | - # enable for Authelia |
| 31 | + # enable for Authelia (requires authelia-server.conf in the server block) |
30 | 32 | #include /config/nginx/authelia-location.conf; |
31 | 33 |
|
| 34 | + # enable for Authentik (requires authentik-server.conf in the server block) |
| 35 | + #include /config/nginx/authentik-location.conf; |
| 36 | + |
32 | 37 | allow 10.0.0.0/8; |
33 | 38 | allow 172.16.0.0/12; |
34 | 39 | allow 192.168.0.0/16; |
35 | 40 | deny all; |
36 | | - |
37 | | - try_files $uri $uri/ /index.php?$args =404; |
| 41 | + |
| 42 | + try_files $uri $uri/ /index.php$is_args$args =404; |
38 | 43 | } |
39 | | - location ~ \.php$ { |
| 44 | + |
| 45 | + location ~ ^(.+\.php)(.*)$ { |
| 46 | + # enable the next two lines for http auth |
| 47 | + #auth_basic "Restricted"; |
| 48 | + #auth_basic_user_file /config/nginx/.htpasswd; |
| 49 | + |
| 50 | + # enable for ldap auth (requires ldap-server.conf in the server block) |
| 51 | + #include /config/nginx/ldap-location.conf; |
| 52 | + |
| 53 | + # enable for Authelia (requires authelia-server.conf in the server block) |
| 54 | + #include /config/nginx/authelia-location.conf; |
| 55 | + |
| 56 | + # enable for Authentik (requires authentik-server.conf in the server block) |
| 57 | + #include /config/nginx/authentik-location.conf; |
| 58 | + |
40 | 59 | allow 10.0.0.0/8; |
41 | 60 | allow 172.16.0.0/12; |
42 | 61 | allow 192.168.0.0/16; |
43 | 62 | deny all; |
44 | | - |
45 | | - fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| 63 | + |
| 64 | + fastcgi_split_path_info ^(.+\.php)(.*)$; |
46 | 65 | fastcgi_pass 127.0.0.1:9000; |
47 | 66 | fastcgi_index index.php; |
48 | 67 | include /etc/nginx/fastcgi_params; |
49 | 68 | } |
50 | 69 | } |
51 | 70 |
|
52 | 71 | server { |
53 | | - listen 443 ssl; |
54 | | - listen [::]:443 ssl; |
| 72 | + listen 443 ssl http2; |
| 73 | + listen [::]:443 ssl http2; |
55 | 74 |
|
56 | 75 | server_name dashboard.*; |
57 | 76 |
|
58 | | - root /dashboard/www; |
59 | | - index index.php; |
| 77 | + root /dashboard/www; |
| 78 | + index index.php; |
60 | 79 |
|
61 | 80 | include /config/nginx/ssl.conf; |
62 | 81 |
|
63 | 82 | client_max_body_size 0; |
64 | 83 |
|
65 | | - # enable for ldap auth, fill in ldap details in ldap.conf |
66 | | - #include /config/nginx/ldap.conf; |
| 84 | + # enable for ldap auth (requires ldap-location.conf in the location block) |
| 85 | + #include /config/nginx/ldap-server.conf; |
67 | 86 |
|
68 | | - # enable for Authelia |
| 87 | + # enable for Authelia (requires authelia-location.conf in the location block) |
69 | 88 | #include /config/nginx/authelia-server.conf; |
70 | 89 |
|
| 90 | + # enable for Authentik (requires authentik-location.conf in the location block) |
| 91 | + #include /config/nginx/authentik-server.conf; |
| 92 | + |
71 | 93 | location / { |
72 | 94 | # enable the next two lines for http auth |
73 | 95 | #auth_basic "Restricted"; |
74 | 96 | #auth_basic_user_file /config/nginx/.htpasswd; |
75 | 97 |
|
76 | | - # enable the next two lines for ldap auth |
77 | | - #auth_request /auth; |
78 | | - #error_page 401 =200 /ldaplogin; |
| 98 | + # enable for ldap auth (requires ldap-server.conf in the server block) |
| 99 | + #include /config/nginx/ldap-location.conf; |
79 | 100 |
|
80 | | - # enable for Authelia |
| 101 | + # enable for Authelia (requires authelia-server.conf in the server block) |
81 | 102 | #include /config/nginx/authelia-location.conf; |
82 | 103 |
|
| 104 | + # enable for Authentik (requires authentik-server.conf in the server block) |
| 105 | + #include /config/nginx/authentik-location.conf; |
| 106 | + |
83 | 107 | allow 10.0.0.0/8; |
84 | 108 | allow 172.16.0.0/12; |
85 | 109 | allow 192.168.0.0/16; |
86 | 110 | deny all; |
87 | | - |
88 | | - try_files $uri $uri/ /index.php?$args =404; |
| 111 | + |
| 112 | + try_files $uri $uri/ /index.php$is_args$args =404; |
89 | 113 | } |
90 | | - location ~ \.php$ { |
| 114 | + |
| 115 | + location ~ ^(.+\.php)(.*)$ { |
91 | 116 | # enable the next two lines for http auth |
92 | 117 | #auth_basic "Restricted"; |
93 | 118 | #auth_basic_user_file /config/nginx/.htpasswd; |
94 | 119 |
|
95 | | - # enable the next two lines for ldap auth |
96 | | - #auth_request /auth; |
97 | | - #error_page 401 =200 /ldaplogin; |
| 120 | + # enable for ldap auth (requires ldap-server.conf in the server block) |
| 121 | + #include /config/nginx/ldap-location.conf; |
98 | 122 |
|
99 | | - # enable for Authelia |
| 123 | + # enable for Authelia (requires authelia-server.conf in the server block) |
100 | 124 | #include /config/nginx/authelia-location.conf; |
101 | 125 |
|
| 126 | + # enable for Authentik (requires authentik-server.conf in the server block) |
| 127 | + #include /config/nginx/authentik-location.conf; |
| 128 | + |
102 | 129 | allow 10.0.0.0/8; |
103 | 130 | allow 172.16.0.0/12; |
104 | 131 | allow 192.168.0.0/16; |
105 | 132 | deny all; |
106 | | - |
107 | | - fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| 133 | + |
| 134 | + fastcgi_split_path_info ^(.+\.php)(.*)$; |
108 | 135 | fastcgi_pass 127.0.0.1:9000; |
109 | 136 | fastcgi_index index.php; |
110 | 137 | include /etc/nginx/fastcgi_params; |
|
0 commit comments