diff options
author | Holden Rohrer <hr@hrhr.dev> | 2023-05-12 21:47:54 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2023-05-12 21:47:54 -0400 |
commit | ca534003b3f07d2045dc1cbb6cddf60223fd3385 (patch) | |
tree | 7f126e65abeb35939c13a81c9947acaaf101248d /nginx.example.conf |
initial commit
Diffstat (limited to 'nginx.example.conf')
-rw-r--r-- | nginx.example.conf | 52 |
1 files changed, 52 insertions, 0 deletions
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; + } + + } + +} |