From eed95ea4f7c3edf5f2c221eac5eb23c1cf5cfb7d Mon Sep 17 00:00:00 2001
From: Aaron LI <aly@aaronly.me>
Date: Tue, 10 Apr 2018 23:23:39 +0800
Subject: web/sites: Clean up liwt.radicale.conf

---
 roles/web/templates/sites/liwt.radicale.conf.j2 | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

(limited to 'roles/web')

diff --git a/roles/web/templates/sites/liwt.radicale.conf.j2 b/roles/web/templates/sites/liwt.radicale.conf.j2
index 30ad727..4ca818a 100644
--- a/roles/web/templates/sites/liwt.radicale.conf.j2
+++ b/roles/web/templates/sites/liwt.radicale.conf.j2
@@ -19,32 +19,18 @@ server {
 
     # Reverse proxy to Radicale
     location / {
-        # Auth through HTTP
-        auth_basic            "Radicale ...";
+        auth_basic            "Radicale requires auth ...";
         auth_basic_user_file  /usr/local/etc/nginx/auth/radicale.passwd;
 
-        # XXX: Hack to support "username@domain"-style logins
+        # XXX: Hack to support "username[@domain]"-style login names
+        # (NOTE: the "@domain" part is optional, so $username is always set)
         if ($remote_user ~ ^(?<user_>[^@/]+)(@[^/]+)?$) {
             set  $username  $user_;
         }
 
-        # When a reverse proxy is used, the path at which Radicale is
-        # available must be provided via the "X-Script-Name" header.
-        # The proxy must remove the location from the URL path that is
-        # forwarded to Radicale.
-        # http://radicale.org/proxy/
-        #
-        #proxy_pass        http://127.0.0.1:5232/;  # Note the trailing "/"
-        #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-Remote-User      $username;
-
         # WSGI interface: http://radicale.org/wsgi/
         include      uwsgi_params;
-        # Require to set 'auth/type' to 'remote_user' in config file
-        uwsgi_param  REMOTE_USER      $username;
+        uwsgi_param  REMOTE_USER  $username;
         uwsgi_pass   unix:/tmp/uwsgi-radicale.sock;
     }
 }
-- 
cgit v1.2.2