A
A
ar_di2016-09-20 15:33:51
Nginx
ar_di, 2016-09-20 15:33:51

We use nginx reverse proxy for IIS. How to upload a large file?

It loads small files without problems, but it stumbles on large ones, I think maybe it crashes on timeout, increased it, but it didn’t help, does anyone know how to fix it?
client_max_body_size not working

worker_processes  auto;

error_log  logs/error.log; #change to your directory
pid        logs/nginx.pid; #change to your directory

events {
    worker_connections  1024;
}

http {
  proxy_buffer_size   128k;
  proxy_buffers   4 256k;
  proxy_busy_buffers_size   256k;
  client_max_body_size 500m;

  server {
        listen 80;
        server_name localhost;
        return 301 https://$server_name$request_uri;
  }
  
  server {
    listen          443 default;
    server_name     domain.ru;		
    server_tokens off;
      
    ssl                     on;
    ssl_certificate         ../ssl/domain.cer;
    ssl_certificate_key     ../ssl/domain.key;
    ssl_session_timeout     5m;
    ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers             HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;
    
    keepalive_timeout 60s;
    sendfile        on;
    tcp_nodelay on;
    tcp_nopush on;		
    
    client_max_body_size 500m;
    client_header_timeout 3m;
    client_body_timeout 3m;
    send_timeout 3m; 		
    
    
    # Optional optimisation - refer http://nginx.org/en/docs/http/configuring_https_servers.html
    # ssl_session_cache   shared:SSL:10m;
    location / { 			
                       sub_filter          'https://192.168.1.10' 'https://domain.ru';
                       sub_filter_once     off;
                       sub_filter_types    text/css text/xml text/javascript application/x-javascript;			
      
      proxy_pass          https://192.168.1.10:443;
      proxy_set_header    Host $host;
                        proxy_set_header    X-Forwarded-Proto $scheme;
      proxy_set_header    X-Forwarded-Host $host;
      proxy_set_header    X-Forwarded-Server $host;
      proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header    X-Real-IP $remote_addr;
      proxy_redirect      https://192.168.1.10 https://domain.ru;
      proxy_connect_timeout       10m;
      proxy_send_timeout          10m;
      proxy_read_timeout          10m;		
      
      gzip on;
      gzip_comp_level 5;
      gzip_proxied any;
      gzip_types text/plain text/xml text/css application/javascript application/x-javascript text/javascript;
      gzip_vary on;
      gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    }
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SwiftBlack, 2019-12-12
@SwiftBlack

How is IIS configured, without nginx loading?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question