docs: adjust nginx example (#4134)

pull/4152/head
James Elliott 2022-10-08 18:45:38 +11:00 committed by GitHub
parent 66f9e27f9e
commit ab2bcfd677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 7 deletions

View File

@ -151,6 +151,15 @@ Below you will find commented examples of the following configuration:
[resolver](https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver) which is standard [resolver](https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver) which is standard
* [NGINX] shares a network with the `authelia` and `nextcloud` containers * [NGINX] shares a network with the `authelia` and `nextcloud` containers
### Assumptions
* Authelia is accessible to [NGINX] process with the hostname `authelia` on port `9091` making the URL
`http://authelia:9091`. If this is not the case adjust all instances of this as appropriate.
* The [NGINX] configuration is in the folder `/config/nginx`. If this is not the case adjust all instances of this as
appropriate.
* The URL you wish Authelia to be accessible on is `https://auth.example.com`. If this is not the case adjust all
instances of this as appropriate.
### Standard Example ### Standard Example
This example is for using the __Authelia__ portal redirection flow on a specific endpoint. It requires you to have the This example is for using the __Authelia__ portal redirection flow on a specific endpoint. It requires you to have the
@ -174,11 +183,15 @@ server {
include /config/nginx/snippets/ssl.conf; include /config/nginx/snippets/ssl.conf;
set $upstream http://authelia:9091;
location / { location / {
include /config/nginx/snippets/proxy.conf; include /config/nginx/snippets/proxy.conf;
proxy_pass $upstream;
}
set $upstream_authelia http://authelia:9091; location /api/verify {
proxy_pass $upstream_authelia; proxy_pass $upstream;
} }
} }
``` ```
@ -205,7 +218,6 @@ server {
location / { location / {
include /config/nginx/snippets/proxy.conf; include /config/nginx/snippets/proxy.conf;
include /config/nginx/snippets/authelia-authrequest.conf; include /config/nginx/snippets/authelia-authrequest.conf;
proxy_pass $upstream; proxy_pass $upstream;
} }
} }
@ -233,7 +245,6 @@ server {
location / { location / {
include /config/nginx/snippets/proxy.conf; include /config/nginx/snippets/proxy.conf;
include /config/nginx/snippets/authelia-authrequest.conf; include /config/nginx/snippets/authelia-authrequest.conf;
proxy_pass $upstream; proxy_pass $upstream;
} }
} }
@ -267,12 +278,12 @@ server {
include /config/nginx/snippets/ssl.conf; include /config/nginx/snippets/ssl.conf;
include /config/nginx/snippets/authelia-location-basic.conf; # Use the "basic" endpoint include /config/nginx/snippets/authelia-location-basic.conf; # Use the "basic" endpoint
set $upstream https://nextcloud;
location / { location / {
include /config/nginx/snippets/proxy.conf; include /config/nginx/snippets/proxy.conf;
include /config/nginx/snippets/authelia-authrequest-basic.conf; include /config/nginx/snippets/authelia-authrequest-basic.conf;
proxy_pass $upstream;
set $upstream_nextcloud https://nextcloud;
proxy_pass $upstream_nextcloud;
} }
} }
``` ```