mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-09 23:08:33 +01:00
feat: support for cert based authentication
This commit is contained in:
@@ -11,6 +11,8 @@ events {
|
||||
|
||||
http {
|
||||
|
||||
{{ maps }}
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
|
||||
10
templates/nginx_maps.j2
Normal file
10
templates/nginx_maps.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
map $ssl_client_s_dn $allow_group_main {
|
||||
default "";
|
||||
~CN=Sheppy2 true;
|
||||
~CN=Kathi true;
|
||||
}
|
||||
|
||||
map $ssl_client_s_dn $allow_group_ths {
|
||||
default "";
|
||||
~OU=THS true;
|
||||
}
|
||||
@@ -13,6 +13,12 @@ server{
|
||||
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
{% if cert_optional %}
|
||||
ssl_client_certificate ca_cert.pem;
|
||||
ssl_verify_client optional;
|
||||
ssl_verify_depth 1;
|
||||
{% endif %}
|
||||
|
||||
{% if extra_location %}
|
||||
location {{ extra_location["location"] }} {
|
||||
@@ -28,6 +34,7 @@ server{
|
||||
proxy_pass http://{{ targetip }}:{{ targetport }};
|
||||
proxy_set_header Host $http_host;
|
||||
{{ proxy_pass_blob }}
|
||||
{{ cert_header_line }}
|
||||
{% if basicauth %}
|
||||
auth_basic "{{ basicauth }}";
|
||||
auth_basic_user_file /etc/nginx/{{ basicauth }}.htpasswd;
|
||||
|
||||
Reference in New Issue
Block a user