Skip to content

Commit 0aaa4fa

Browse files
authored
Merge pull request #266 from linuxserver/fix-authelia-conf
Update authelia-server.conf.sample
2 parents 58c0c03 + b346b46 commit 0aaa4fa

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed
Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
1-
## Version 2022/08/22 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authelia-server.conf.sample
1+
## Version 2022/09/22 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authelia-server.conf.sample
22
# Make sure that your authelia container is in the same user defined bridge network and is named authelia
33

44
location ^~ /authelia {
5-
6-
set $upstream_app authelia;
7-
set $upstream_port 9091;
8-
set $upstream_proto http;
9-
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
5+
include /config/nginx/proxy.conf;
6+
include /config/nginx/resolver.conf;
7+
set $upstream_authelia authelia;
8+
proxy_pass http://$upstream_authelia:9091;
109
}
1110

1211
location = /authelia/api/verify {
1312
internal;
1413

15-
set $upstream_app authelia;
16-
set $upstream_port 9091;
17-
set $upstream_proto http;
18-
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
14+
include /config/nginx/resolver.conf;
15+
set $upstream_authelia authelia;
16+
proxy_pass_request_body off;
17+
proxy_pass http://$upstream_authelia:9091;
18+
proxy_set_header Content-Length "";
1919

2020
# Timeout if the real server is dead
2121
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
2222

23+
# [REQUIRED] Needed by Authelia to check authorizations of the resource.
24+
# Provide either X-Original-URL and X-Forwarded-Proto or
25+
# X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Uri or both.
26+
# Those headers will be used by Authelia to deduce the target url of the user.
27+
# Basic Proxy Config
2328
client_body_buffer_size 128k;
29+
proxy_set_header Host $host;
30+
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
31+
proxy_set_header X-Real-IP $remote_addr;
32+
proxy_set_header X-Forwarded-For $remote_addr;
33+
proxy_set_header X-Forwarded-Method $request_method;
34+
proxy_set_header X-Forwarded-Proto $scheme;
35+
proxy_set_header X-Forwarded-Host $http_host;
36+
proxy_set_header X-Forwarded-Uri $request_uri;
37+
proxy_set_header X-Forwarded-Ssl on;
38+
proxy_redirect http:// $scheme://;
39+
proxy_http_version 1.1;
40+
proxy_set_header Connection "";
41+
proxy_cache_bypass $cookie_session;
42+
proxy_no_cache $cookie_session;
2443
proxy_buffers 4 32k;
25-
proxy_pass_request_body off;
26-
proxy_set_header Content-Length "";
44+
45+
# Advanced Proxy Config
2746
send_timeout 5m;
47+
proxy_read_timeout 240;
48+
proxy_send_timeout 240;
49+
proxy_connect_timeout 240;
2850
}

0 commit comments

Comments
 (0)