+ optional ssl for nginx

This commit is contained in:
qemu-test
2024-10-18 15:33:29 +03:00
parent 2db44cb74e
commit 184fc3dc2d
4 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,14 @@
error_page 419 = @https;
set $is_https "0";
if ( $scheme ~* "^https") {
set $is_https "${is_https}1";
}
if ( $request_uri ~* "api/v") {
set $is_https "${is_https}1";
}
if ( $is_https = "0" ) {
return 419;
}
location @https {
rewrite ^ https://$http_host$request_uri permanent;
}

2
config/nginx/ssl.d/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore