最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Authelia nginx pathprefix - Stack Overflow

programmeradmin5浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论