-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-example.conf
45 lines (38 loc) · 1.08 KB
/
nginx-example.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
# Example of a subrequest auth protected directory.
location /protected {
auth_request /login/validate;
error_page 401 = @error401;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass php-handler;
}
}
# IndieAuth authorization endpoint.
location =/auth/ {
include fastcgi_params;
fastcgi_pass php-handler;
fastcgi_param SCRIPT_FILENAME /srv/indieauth/auth/auth.php;
}
# IndieAuth token endpoint.
location =/tokens/ {
include fastcgi_params;
fastcgi_pass php-handler;
fastcgi_param SCRIPT_FILENAME /srv/indieauth/token/tokens.php;
}
# IndieAuth login page
location =/login/ {
include fastcgi_params;
fastcgi_pass php-handler;
fastcgi_param SCRIPT_FILENAME /srv/indieauth/login/login.php;
}
# IndieAuth auth_request validation route.
location =/login/validate {
internal;
include fastcgi_params;
fastcgi_pass php-handler;
fastcgi_param SCRIPT_FILENAME /srv/indieauth/login/validate.php;
}
# Redirect all 401 errors to login page.
location @error401 {
return 302 /login?url=$scheme://$http_host$request_uri;
}