-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
nginx.conf
62 lines (49 loc) · 2.03 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
server {
listen *:80;
server_name localhost;
client_max_body_size 10024M;
client_body_buffer_size 10024M;
client_body_timeout 120;
add_header X-Clacks-Overhead "GNU Terry Pratchett";
add_header X-Clacks-Overhead "GNU Terry Pratchet";
add_header Access-Control-Allow-Origin *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
location /images {
alias /var/www/images;
}
location ~* \.(php|aspx|myadmin|asp)$ {
deny all;
}
location / {
include /etc/nginx/uwsgi_params.par;
uwsgi_pass uwsgi:3031;
uwsgi_max_temp_file_size 10024m;
}
location /static {
alias /var/www/static;
}
# Upload form should be submitted to this location
location /upload {
# Pass altered request body to this location
upload_pass /api/uploads/complete/;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
upload_store /var/www/images/_upload 1;
upload_store_access user:rw group:rw all:rw;
# Set specified fields in request body
upload_set_form_field $upload_field_name.name "$upload_file_name";
upload_set_form_field $upload_field_name.content_type "$upload_content_type";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
# Inform backend about hash and size of a file
upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";
upload_pass_form_field "^submit$|^description$";
upload_pass_form_field "^SREGISTRY_EVENT$";
upload_pass_form_field "^collection$";
upload_pass_form_field "^name$";
upload_pass_form_field "^tag$";
upload_cleanup 400-599;
}
}