Nginx notes

Passwords

sudo htpasswd -c /etc/nginx/.htpasswd user-name

config:

auth_basic "realm";
auth_basic_user_file /etc/nginx/.htpasswd

CORS

if ($http_origin) {
  add_header 'Access-Control-Allow-Origin' "https://demo.solsort.dk" always;
  add_header 'Access-Control-Allow-Methods' "OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT, MKCOL" always;
  add_header 'Access-Control-Allow-Credentials' "true" always;
  add_header 'Access-Control-Allow-Headers' "Content-Type, Accept, ETag, DAV, Authorization" always;
}

  # # If service that fails on options
  # if ($request_method = OPTIONS) {
  #   return 204;
  # }

WebDAV

create_full_put_path on