Skip to content

Commit

Permalink
Add http2 to listen directive (#715)
Browse files Browse the repository at this point in the history
* Add http2 to listen directive

Signed-off-by: GitHub <[email protected]>

* Update dashboard.subdomain.conf.sample

* Update dashboard.subdomain.conf.sample

* Add auth comments for php location

---------

Signed-off-by: GitHub <[email protected]>
  • Loading branch information
nemchik authored Jun 12, 2023
1 parent 601d171 commit fad06b5
Showing 1 changed file with 63 additions and 36 deletions.
99 changes: 63 additions & 36 deletions root/dashboard/dashboard.subdomain.conf.sample
Original file line number Diff line number Diff line change
@@ -1,110 +1,137 @@
## 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;
}
}

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;
Expand Down

0 comments on commit fad06b5

Please sign in to comment.