diff --git a/root/dashboard/dashboard.subdomain.conf.sample b/root/dashboard/dashboard.subdomain.conf.sample index 78ff5935..8c4a416c 100644 --- a/root/dashboard/dashboard.subdomain.conf.sample +++ b/root/dashboard/dashboard.subdomain.conf.sample @@ -1,48 +1,67 @@ -## Version 2022/03/19 -# Make sure that your dns has a cname set for dashboard +## Version 2022/06/05 +# make sure that your dns has a cname set for dashboard server { listen 81; server_name _; - root /dashboard/www; - index index.php; + root /dashboard/www; + index index.php; client_max_body_size 0; - # enable for ldap auth, fill in ldap details in ldap.conf - #include /config/nginx/ldap.conf; + # enable for ldap auth (requires ldap-location.conf in the location block) + #include /config/nginx/ldap-server.conf; - # enable for Authelia + # enable for Authelia (requires authelia-location.conf in the location block) #include /config/nginx/authelia-server.conf; + # enable for Authentik (requires authentik-location.conf in the location block) + #include /config/nginx/authentik-server.conf; + location / { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; - # enable the next two lines for ldap auth - #auth_request /auth; - #error_page 401 =200 /ldaplogin; + # enable for ldap auth (requires ldap-server.conf in the server block) + #include /config/nginx/ldap-location.conf; - # enable for Authelia + # enable for Authelia (requires authelia-server.conf in the server block) #include /config/nginx/authelia-location.conf; + # enable for Authentik (requires authentik-server.conf in the server block) + #include /config/nginx/authentik-location.conf; + allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; - - try_files $uri $uri/ /index.php?$args =404; + + try_files $uri $uri/ /index.php$is_args$args =404; } - location ~ \.php$ { + + location ~ ^(.+\.php)(.*)$ { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable for ldap auth (requires ldap-server.conf in the server block) + #include /config/nginx/ldap-location.conf; + + # enable for Authelia (requires authelia-server.conf in the server block) + #include /config/nginx/authelia-location.conf; + + # enable for Authentik (requires authentik-server.conf in the server block) + #include /config/nginx/authentik-location.conf; + allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; - - fastcgi_split_path_info ^(.+\.php)(/.+)$; + + fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /etc/nginx/fastcgi_params; @@ -50,61 +69,69 @@ server { } server { - listen 443 ssl; - listen [::]:443 ssl; + listen 443 ssl http2; + listen [::]:443 ssl http2; server_name dashboard.*; - root /dashboard/www; - index index.php; + root /dashboard/www; + index index.php; include /config/nginx/ssl.conf; client_max_body_size 0; - # enable for ldap auth, fill in ldap details in ldap.conf - #include /config/nginx/ldap.conf; + # enable for ldap auth (requires ldap-location.conf in the location block) + #include /config/nginx/ldap-server.conf; - # enable for Authelia + # enable for Authelia (requires authelia-location.conf in the location block) #include /config/nginx/authelia-server.conf; + # enable for Authentik (requires authentik-location.conf in the location block) + #include /config/nginx/authentik-server.conf; + location / { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; - # enable the next two lines for ldap auth - #auth_request /auth; - #error_page 401 =200 /ldaplogin; + # enable for ldap auth (requires ldap-server.conf in the server block) + #include /config/nginx/ldap-location.conf; - # enable for Authelia + # enable for Authelia (requires authelia-server.conf in the server block) #include /config/nginx/authelia-location.conf; + # enable for Authentik (requires authentik-server.conf in the server block) + #include /config/nginx/authentik-location.conf; + allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; - - try_files $uri $uri/ /index.php?$args =404; + + try_files $uri $uri/ /index.php$is_args$args =404; } - location ~ \.php$ { + + location ~ ^(.+\.php)(.*)$ { # enable the next two lines for http auth #auth_basic "Restricted"; #auth_basic_user_file /config/nginx/.htpasswd; - # enable the next two lines for ldap auth - #auth_request /auth; - #error_page 401 =200 /ldaplogin; + # enable for ldap auth (requires ldap-server.conf in the server block) + #include /config/nginx/ldap-location.conf; - # enable for Authelia + # enable for Authelia (requires authelia-server.conf in the server block) #include /config/nginx/authelia-location.conf; + # enable for Authentik (requires authentik-server.conf in the server block) + #include /config/nginx/authentik-location.conf; + allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; - - fastcgi_split_path_info ^(.+\.php)(/.+)$; + + fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /etc/nginx/fastcgi_params;