SWAG+Authelia 401/403 Redirect Behaviour

SWAG: 1.27.0
Authelia: 4.35.6
Docker CE: 20.10.16

SWAG + Authelia running on Docker, managed with Portainer 2.13.1

Only relevant issue I have on Authelia (most likely) I could find #192

Hey all,

I’m getting started with SWAG+Authelia using iRedMail LDAP. So far only using 1FA, stretching my legs as it were and understanding the systems at work. Eventually want to setup 2FA, but we’ll get there.

As part of my SWAG proxy setup, I have custom error pages defined on all my servers by include file. I saw in issue #192 that there seems to be a mechanism in place for Authelia 401/403 redirect already, but I don’t see it working? I thought perhaps my custom defined error pages were overwriting it so I removed the include line from a server with Authelia configured for testing but I still just get the empty 403 error message (for a user that’s attempting to view a resource they don’t have privs for). I can see the 403 in Chrome Network inspector, but not any call for the custom page. What am I missing? The custom error pages work on servers with no Authelia setup.

Here’s the error page include config, though to note, I’m not seeing the behaviour discussed in #192 even if I remove the include (lines are part of include file on each server define):

error_page 403 /403.html;
error_page 404 /404.html;
error_page 429 /429.html;
error_page 400 401 402 405 406 407 408 409 410 411 412 413 414 415 416 417 418 421 422 423 424 425 426 428 431 451 4xx.html;
error_page 502 503 504 /502.html;
error_page 500 501 505 506 507 508 510 511 5xx.html;

location = /403.html {
	root /config/www;
	allow all;
}
location = /404.html {
	root /config/www;
	allow all;
}
location = /429.html {
	root /config/www;
	allow all;
}
location = /4xx.html {
	root /config/www;
	allow all;
}
location = /502.html {
	root /config/www;
	allow all;
}
location = /5xx.html {
	root /config/www;
	allow all;
}

image

Desired Outcomes: Either Authelia redirects working as seems to be insinuated by #192, or understanding of why designed custom error pages are not shown by Authelia.