nginx 1.9.14 & upload-progress-module
deniss
nginx-forum на forum.nginx.org
Сб Апр 9 18:00:18 UTC 2016
1 ## SHARE ###
2
3 server {
4 listen 217.199.213.6:80;
5 server_name share.domain.com;
6 upload_set_form_field $upload_field_name.name
"$upload_file_name";
7 upload_set_form_field $upload_field_name.mime
"$upload_content_type";
8 upload_set_form_field $upload_field_name.path
"$upload_tmp_path";
9 upload_aggregate_form_field $upload_field_name.sha
"$upload_file_sha1";
10 upload_aggregate_form_field $upload_field_name.size
"$upload_file_size";
11 upload_pass_form_field
"^desc$|^folder_id$";
12 upload_store /mnt/files/tmp;
13 upload_cleanup 400-599;
14 error_log /var/logs/share_nginx_error.log
debug;
15
16 location / {
17 proxy_pass http://127.0.0.1:80;
18 proxy_set_header Host $host;
19 proxy_set_header X-Real-IP $remote_addr;
20 proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
21 track_uploads proxied 30s;
22 proxy_pass_header Authorization;
23 access_log
/var/logs/share_nginx_access.log;
24 }
25
26 location /doupload {
27 upload_pass /doneupload;
28 track_uploads proxied 30s;
29 # access_log
/var/log/share_nginx_access.log;
30 }
31
32 location /doneupload {
33 proxy_pass http://127.0.0.1:80/doupload;
34 proxy_set_header Host $host;
35 proxy_set_header X-Real-IP $remote_addr;
36 proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
37 # access_log
/var/log/share_nginx_access.log;
38 }
39
40 location /media {
41 root /var/www/share;
42 # access_log
/var/log/share_nginx_access.log;
43 }
44
45 location /error {
46 root /var/www/error/;
47 }
48
49 location ^~ /progress {
50 expires off;
51 add_header Pragma no-cache;
52 add_header Cache-Control
no-cache,must-revalidate;
53 report_uploads proxied;
54 # access_log
/var/log/share_nginx_access.log;
55 }
56
57 location /uploaded_files {
58 root /mnt/files;
59 internal;
60 # limit_conn one 5;
61 # directio 1m;
62 # access_log
/var/log/share_nginx_access.log;
63 }
64
65 location /previews {
66 root /mnt/files;
67 }
68
69 location = /nginx_status {
70 stub_status on;
71 access_log off;
72 allow 217.199.213.6;
73 allow 127.0.0.1;
74 deny all;
75 }
76
77 }
Posted at Nginx Forum: https://forum.nginx.org/read.php?21,266053,266054#msg-266054
Подробная информация о списке рассылки nginx-ru