首页 > 解决方案 > ERR_INCOMPLETE_CHUNKED_ENCODING 与 LEMP 和 WSL

问题描述

我在 WSL Debian 上建立了一个 WordPress 站点。我无需登录即可访问 localhost 站点,但登录后无法访问管理页面。当我尝试访问管理页面时,浏览器的控制台会显示此错误 ERR_INCOMPLETE_CHUNKED_ENCODING。这是我的 wordpress.conf 文件:

server {
        listen 80;
        listen [::]:80;
        root /var/www/html/wordpress;
        index  index.php index.html index.htm;
        server_name mysite.com www.mysite.com;

        error_log /var/log/nginx/mysite.com_error.log;
        access_log /var/log/nginx/mysite.com_access.log;

        client_max_body_size 100M;
        location / {
                try_files $uri $uri/ /index.php?$args;

        }
        location ~ \.php$ {
               fastcgi_buffering off;
              include snippets/fastcgi-php.conf;
               fastcgi_pass 127.0.0.1:9000;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
             }
}

这是 nginx.conf 文件

user www-data;
worker_processes auto;
pid /run/nginx.pid;
master_process off;

#include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {


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

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

        ##
        # Gzip Settings
        ##

        gzip on;

        # 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/javascript text/xml application/xml application/xml+rss text/javascript;
       include /etc/nginx/sites-enabled/*;
}

我参考了这个 GitHub 页面https://github.com/microsoft/WSL/issues/2100并对 conf 文件进行了更改(在 HTTP 块中添加了 fastcgi_buffering),但我仍然收到错误消息。如何解决这个问题?

标签: wordpressnginxwindows-subsystem-for-linux

解决方案


推荐阅读