nginx不允许启用SSL的大文件上传

时间:2017-01-18 11:13:25

标签: ssl nginx proxy upload

当我设置client_max_body_size 0时;没有ssl,文件上传过程正常。但是,当我切换到ssl时,它完全忽略了这个指令。这只发生在nginx上,如果我只使用帆,它可以通过SSL工作正常。调试日志位于帖子的底部。

我对nginx.conf的配置如下所示:

Array
(
    [0] => link1
    [1] => link2
)
Array
(
    [0] => [BIOL 107 Section 1] Concepts in Biology
    [1] => [CENG 230 Section 7] Introduction to C Programming
)

我的VHost配置如下:

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    #server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;
    client_max_body_size 0;

以下是调试日志不起作用时:

server {
    listen 80 default_server;
   server_name mysite.co.uk;
   return 301 https://$server_name$request_uri;

}



server {
listen 443;
ssl on;
server_name mysslsite.co.uk;
    client_max_body_size 0;

ssl_certificate /ssl/mycert.pem;
ssl_certificate_key /ssl/mycertkey.key;
proxy_set_header X-Forwarded-For $remote_addr;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
server_tokens off;

location / {
    client_body_temp_path /tmp/;
    client_max_body_size 0;
    access_log      /var/log/nginx/access.log;
    error_log       /var/log/nginx/error.log;
    proxy_request_buffering off;
    proxy_pass https://localip:port;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}
}

对于我可能遗失的任何想法都将不胜感激。

0 个答案:

没有答案