From ca534003b3f07d2045dc1cbb6cddf60223fd3385 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 12 May 2023 21:47:54 -0400 Subject: initial commit --- nginx.example.conf | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 nginx.example.conf (limited to 'nginx.example.conf') diff --git a/nginx.example.conf b/nginx.example.conf new file mode 100644 index 0000000..757b614 --- /dev/null +++ b/nginx.example.conf @@ -0,0 +1,52 @@ +load_module modules/ngx_http_jwted_module.so; + +#user html; +worker_processes 1; + +error_log /var/log/nginx/error.log; + +#pid logs/nginx.pid; + + +events { + worker_connections 1024; +} + +http { + include mime.types; + + auth_jwt_key 'WKaDRAk7hx4ZiY5zV3H6cnGCzloBgWbV2FC1poLfzLY='; + auth_jwt_cache on; + + server { + listen 80; + server_name localhost; + #charset koi8-r; + + location = /auth { + proxy_pass http://localhost:5000; + } + + location = /logout { + proxy_pass http://localhost:5000; + } + + #access_log logs/host.access.log main; + location = /login { + root /var/lib/weblogin; + try_files $uri.html =404; + } + + location @login_redirect { + return 302 /login; + } + + location / { + auth_jwt $cookie_auth; + error_page 401 = @login_redirect; + root /usr/share/nginx/html; + } + + } + +} -- cgit