-
Notifications
You must be signed in to change notification settings - Fork 31
/
nginx.conf
38 lines (28 loc) · 869 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
worker_processes 1;
error_log /dev/stderr warn;
events {
worker_connections 1024;
}
# make sure to set plaintext JWT_SECRET environment variable
env JWT_SECRET;
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
lua_package_path "/usr/local/openresty/lualib/?.lua;;";
server {
listen 8080;
location / {
default_type text/html;
content_by_lua '
ngx.say("<p>hello, unprotected lua world</p>")
';
}
location /secure/ {
access_by_lua_file /bearer.lua;
default_type text/plain;
echo "<p>i am protected by jwt<p>";
}
}
}