nginx -V
nginx version: nginx/1.11.9
built by gcc 4.9.2
built with OpenSSL 1.1.0b 26 Sep 2016
TLS SNI support enabled
--with-http_perl_module
Пытаюсь настроить загрузку файлов на сервер через nginx следующим образом:
server {
listen 443 ssl;
server_name example.com;
ssl_certificate key.pem;
ssl_certificate_key privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam dhparams.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
root /var/www/html;
error_log /var/log/nginx/example.com-error.log;
access_log /var/log/nginx/example.com-access.log main;
index index.html;
location /upload {
#auth_basic "Restricted Upload";
#auth_basic_user_file /etc/nginx/conf.d/basic.htpasswd;
limit_except POST { deny all; }
client_body_temp_path /tmp/;
client_body_in_file_only on;
client_body_buffer_size 128K;
client_max_body_size 10M;
proxy_pass_request_headers on;
proxy_set_header X-FILE $request_body_file;
proxy_set_body off;
proxy_redirect off;
proxy_pass http://localhost:8001/;
}
}
server {
listen 127.0.0.1:8001;
root /opt/uploadfiles/files;
error_log /var/log/nginx/upload-error.log;
access_log /var/log/nginx/upload-access.log main;
location / {
index index.html;
}
}
В итоге проверка курлом показывает 403 ошибку
curl --data-binary '@filename' https://example.com/upload
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
Права на директорию имеются
ls -l /opt/uploadfiles/
drwxrwxrwx 2 www-data www-data 4096 May 22 13:00 files
Что нужно еще добавить в конфигурирования nginx?