Last active
November 25, 2017 00:46
-
-
Save arosh/48dc775fec139fa6db02a68d106bd431 to your computer and use it in GitHub Desktop.
Nginx WebDAV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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