NGINX代理图片消失

时间:2016-10-13 07:23:53

标签: nginx proxy substitution chunked-encoding

也许有人可以帮我解决这个问题。 我使用--with-http_sub_module重定向nginx上的网站。 因此,它在许多网站上运行良好,除了其中一个网站上的一张图片。

奇怪的是我有另一个网站重定向,有一张图片正在运行......我对此毫无头绪......

图片与chunked_encoding fehler:59.6 kB

图片正常工作:43.3 kB

我可以看到它在那里的图片,但只有几毫秒然后我得到错误:net :: ERR_INCOMPLETE_CHUNKED_ENCODING

首先是我的NGINX.conf:

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

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;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    #proxy_set_header        X-Real-IP       $remote_addr;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

所以我的Proxy_config是:

{
    proxy_buffering             off;
    proxy_buffers            8  24k;
    proxy_buffer_size           2k;

    proxy_http_version          1.1;
    proxy_headers_hash_max_size 1024;
    proxy_headers_hash_bucket_size 128;
    sub_filter_types            *;
    access_log                  off;

    proxy_redirect              http                    https;
    proxy_set_header            Host                    $host;

    proxy_set_header            Upgrade                 $http_upgrade;
    proxy_set_header            Connection              close;

    proxy_set_header            Accept-Encoding         "";
    proxy_set_header            X-Forwarded-Proto       $scheme;
    proxy_set_header            X-Real-IP               $remote_addr;
    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;}

你对此有所了解吗? 我已经尝试了--with-http_sub_module网站上的每个选项,但似乎没有任何效果。

0 个答案:

没有答案