aboutsummaryrefslogtreecommitdiff
path: root/nginx.example.conf
diff options
context:
space:
mode:
Diffstat (limited to 'nginx.example.conf')
-rw-r--r--nginx.example.conf52
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;
+ }
+
+ }
+
+}