location = /agendav { return 301 https://$host/agendav/; } location /agendav/ { # The trailing / is important! proxy_pass http://127.0.0.1:8099/; # The / is important! proxy_set_header Connection $http_connection; proxy_set_header Upgrade $http_upgrade; proxy_set_header Host $host; proxy_set_header Authorization ""; }