Skip to content

Commit fad06b5

Browse files
authored
Add http2 to listen directive (#715)
* Add http2 to listen directive Signed-off-by: GitHub <noreply@github.com> * Update dashboard.subdomain.conf.sample * Update dashboard.subdomain.conf.sample * Add auth comments for php location --------- Signed-off-by: GitHub <noreply@github.com>
1 parent 601d171 commit fad06b5

File tree

1 file changed

+63
-36
lines changed

1 file changed

+63
-36
lines changed

root/dashboard/dashboard.subdomain.conf.sample

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,137 @@
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
33

44
server {
55
listen 81;
66

77
server_name _;
88

9-
root /dashboard/www;
10-
index index.php;
9+
root /dashboard/www;
10+
index index.php;
1111

1212
client_max_body_size 0;
1313

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;
1616

17-
# enable for Authelia
17+
# enable for Authelia (requires authelia-location.conf in the location block)
1818
#include /config/nginx/authelia-server.conf;
1919

20+
# enable for Authentik (requires authentik-location.conf in the location block)
21+
#include /config/nginx/authentik-server.conf;
22+
2023
location / {
2124
# enable the next two lines for http auth
2225
#auth_basic "Restricted";
2326
#auth_basic_user_file /config/nginx/.htpasswd;
2427

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;
2830

29-
# enable for Authelia
31+
# enable for Authelia (requires authelia-server.conf in the server block)
3032
#include /config/nginx/authelia-location.conf;
3133

34+
# enable for Authentik (requires authentik-server.conf in the server block)
35+
#include /config/nginx/authentik-location.conf;
36+
3237
allow 10.0.0.0/8;
3338
allow 172.16.0.0/12;
3439
allow 192.168.0.0/16;
3540
deny all;
36-
37-
try_files $uri $uri/ /index.php?$args =404;
41+
42+
try_files $uri $uri/ /index.php$is_args$args =404;
3843
}
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+
4059
allow 10.0.0.0/8;
4160
allow 172.16.0.0/12;
4261
allow 192.168.0.0/16;
4362
deny all;
44-
45-
fastcgi_split_path_info ^(.+\.php)(/.+)$;
63+
64+
fastcgi_split_path_info ^(.+\.php)(.*)$;
4665
fastcgi_pass 127.0.0.1:9000;
4766
fastcgi_index index.php;
4867
include /etc/nginx/fastcgi_params;
4968
}
5069
}
5170

5271
server {
53-
listen 443 ssl;
54-
listen [::]:443 ssl;
72+
listen 443 ssl http2;
73+
listen [::]:443 ssl http2;
5574

5675
server_name dashboard.*;
5776

58-
root /dashboard/www;
59-
index index.php;
77+
root /dashboard/www;
78+
index index.php;
6079

6180
include /config/nginx/ssl.conf;
6281

6382
client_max_body_size 0;
6483

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;
6786

68-
# enable for Authelia
87+
# enable for Authelia (requires authelia-location.conf in the location block)
6988
#include /config/nginx/authelia-server.conf;
7089

90+
# enable for Authentik (requires authentik-location.conf in the location block)
91+
#include /config/nginx/authentik-server.conf;
92+
7193
location / {
7294
# enable the next two lines for http auth
7395
#auth_basic "Restricted";
7496
#auth_basic_user_file /config/nginx/.htpasswd;
7597

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;
79100

80-
# enable for Authelia
101+
# enable for Authelia (requires authelia-server.conf in the server block)
81102
#include /config/nginx/authelia-location.conf;
82103

104+
# enable for Authentik (requires authentik-server.conf in the server block)
105+
#include /config/nginx/authentik-location.conf;
106+
83107
allow 10.0.0.0/8;
84108
allow 172.16.0.0/12;
85109
allow 192.168.0.0/16;
86110
deny all;
87-
88-
try_files $uri $uri/ /index.php?$args =404;
111+
112+
try_files $uri $uri/ /index.php$is_args$args =404;
89113
}
90-
location ~ \.php$ {
114+
115+
location ~ ^(.+\.php)(.*)$ {
91116
# enable the next two lines for http auth
92117
#auth_basic "Restricted";
93118
#auth_basic_user_file /config/nginx/.htpasswd;
94119

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;
98122

99-
# enable for Authelia
123+
# enable for Authelia (requires authelia-server.conf in the server block)
100124
#include /config/nginx/authelia-location.conf;
101125

126+
# enable for Authentik (requires authentik-server.conf in the server block)
127+
#include /config/nginx/authentik-location.conf;
128+
102129
allow 10.0.0.0/8;
103130
allow 172.16.0.0/12;
104131
allow 192.168.0.0/16;
105132
deny all;
106-
107-
fastcgi_split_path_info ^(.+\.php)(/.+)$;
133+
134+
fastcgi_split_path_info ^(.+\.php)(.*)$;
108135
fastcgi_pass 127.0.0.1:9000;
109136
fastcgi_index index.php;
110137
include /etc/nginx/fastcgi_params;

0 commit comments

Comments
 (0)