i have a question about how to host authelia using a PathPrefix /authelia rather than a subdomain with nginx? i found solution for traiefik
I tried to set
server:
address: 'tcp://0.0.0.0:9091/authelia'
and my nginx.conf have locations to server static files
http {
resolver 127.0.0.11;
server_tokens off;
charset utf-8;
server {
listen 443 ssl;
server_name datalens.radsciens.ru;
include /config/nginx/snippets/ssl.conf;
# Datalens with Authelia
location /datalens/ {
auth_request /authelia/api/verify;
auth_request_set $user $upstream_http_remote_user;
proxy_pass http://datalens:8080/collections;
}
location /authelia/ {
proxy_pass http://authelia:9091/authelia/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Uri /authelia/;
proxy_set_header X-Forwarded-Prefix /authelia;
rewrite ^/authelia(/.*)$ $1 break;
}
# Ensure static files are routed correctly
location /authelia/static/ {
proxy_pass http://authelia:9091/authelia/static/;
}
}
}
but authelia try get files just from /static/
not from /authelia/static/
it's looks like this
Thanks for your help!
enter image description here