familytree

A self-hosted family tree builder.
Log | Files | Refs | README

family (2408B)


      1 server {
      2     server_name familytree.piribauer.ch;
      3 
      4     location /outpost.goauthentik.io {
      5         proxy_pass              http://127.0.0.1:9000/outpost.goauthentik.io;
      6         proxy_set_header        Host $host;
      7         proxy_set_header        X-Original-URL $scheme://$host$request_uri;
      8         proxy_set_header        X-Real-IP $remote_addr;
      9         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
     10         proxy_set_header        X-Forwarded-Proto $scheme;
     11         proxy_pass_request_body off;
     12         proxy_set_header        Content-Length "";
     13         add_header              Set-Cookie $auth_cookie;
     14         auth_request_set        $auth_cookie $upstream_http_set_cookie;
     15     }
     16 
     17     location @goauthentik_proxy_signin {
     18         internal;
     19         add_header Set-Cookie $auth_cookie;
     20         return 302 /outpost.goauthentik.io/start?rd=$scheme://$http_host$request_uri;
     21     }
     22 
     23     location / {
     24         proxy_pass         http://127.0.0.1:8766;
     25         proxy_set_header   Host $host;
     26         proxy_set_header   X-Real-IP $remote_addr;
     27         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
     28         proxy_set_header   X-Forwarded-Proto $scheme;
     29 
     30         auth_request       /outpost.goauthentik.io/auth/nginx;
     31         error_page 401     = @goauthentik_proxy_signin;
     32 
     33         auth_request_set $auth_cookie           $upstream_http_set_cookie;
     34         auth_request_set $authentik_username    $upstream_http_x_authentik_username;
     35         auth_request_set $authentik_email       $upstream_http_x_authentik_email;
     36         auth_request_set $authentik_name        $upstream_http_x_authentik_name;
     37 
     38         add_header         Set-Cookie $auth_cookie;
     39 
     40         proxy_set_header   X-Authentik-Username $authentik_username;
     41         proxy_set_header   X-Authentik-Email    $authentik_email;
     42         proxy_set_header   X-Authentik-Name     $authentik_name;
     43     }
     44 
     45     listen 443 ssl;
     46     ssl_certificate /etc/letsencrypt/live/piribauer.ch/fullchain.pem; # managed by Certbot
     47     ssl_certificate_key /etc/letsencrypt/live/piribauer.ch/privkey.pem; # managed by Certbot
     48     include             /etc/letsencrypt/options-ssl-nginx.conf;
     49     ssl_dhparam         /etc/letsencrypt/ssl-dhparams.pem;
     50 
     51 }
     52 
     53 server {
     54     if ($host = familytree.piribauer.ch) {
     55         return 301 https://$host$request_uri;
     56     }
     57     listen      80;
     58     server_name familytree.piribauer.ch;
     59     return      404;
     60 
     61 
     62 }