-
Notifications
You must be signed in to change notification settings - Fork 7
/
example.nginx.conf
49 lines (41 loc) · 1.33 KB
/
example.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
39
40
41
42
43
44
45
46
47
48
49
env STORMPATH_CLIENT_APIKEY_ID;
env STORMPATH_CLIENT_APIKEY_SECRET;
env STORMPATH_APPLICATION_HREF;
events {
worker_connections 256;
}
http {
# DNS Resolver. You can use your own.
resolver 4.2.2.4;
# You may need to configure this to use a different file. Please see the Readme.
lua_ssl_trusted_certificate /etc/pki/tls/certs/ca-bundle.crt;
lua_ssl_verify_depth 2;
server {
listen 8080;
error_page 401 /empty;
location /getAccount/ {
access_by_lua_block {
local stormpath = require("stormpath-nginx")
stormpath.getAccount()
}
proxy_pass https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending;
}
location /requireAccount/ {
access_by_lua_block {
local stormpath = require("stormpath-nginx")
stormpath.requireAccount()
}
proxy_pass https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending;
}
location = /oauth/token {
content_by_lua_block {
local stormpath = require('stormpath-nginx')
stormpath.oauthTokenEndpoint()
}
}
location /empty {
internal;
return 200 '';
}
}
}