Skip to content

Instantly share code, notes, and snippets.

@arosh
Last active November 25, 2017 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arosh/48dc775fec139fa6db02a68d106bd431 to your computer and use it in GitHub Desktop.
Save arosh/48dc775fec139fa6db02a68d106bd431 to your computer and use it in GitHub Desktop.
Nginx WebDAV
user www-data;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 10240;
}
http {
sendfile on;
tcp_nopush on;
etag off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format with_time '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time';
access_log /var/log/nginx/access.log with_time;
error_log /var/log/nginx/error.log;
server {
location / {
root /home/isucon/webdav/data;
autoindex on;
client_body_temp_path /dev/shm/client_body_temp 1 2;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access group:rw all:r;
}
}
}
import requests
data = 'こんにちは,WebDav'
r = requests.put('http://localhost/py.txt', data=data.encode('UTF-8'))
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment