2016-08-30 1 views
2

Bonjour, Je suis en train de montrer un grand JSON en utilisant php mais quand fichier JSON est grand et je reçois Net::ERR_INCOMPLETE_CHUNKED_ENCODING voirNginx Net :: ERR_INCOMPLETE_CHUNKED_ENCODING en essayant de montrer un grand JSON

«/var/lib/nginx/FastCGI/1/00 ​​/ 0000000001" a échoué (13: autorisation refusée ) lors de la lecture en amont

dans mon journal nginx.

Mon serveur nginx démarre à partir de l'utilisateur www-data.

ps aux | grep nginx 
root   1 0.0 0.0 95592 8872 ?  Ss 12:08 0:00 nginx: master process nginx -g daemon off; 
www-data  7 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data  8 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data  9 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 10 0.0 0.0 95960 5600 ?  S 12:08 0:00 nginx: worker process 
www-data 11 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 12 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 13 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 14 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 15 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 16 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 17 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 18 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 19 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 20 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 21 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 22 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 23 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 24 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 25 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 26 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 27 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 28 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 29 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 30 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 31 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 32 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 33 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 34 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 35 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 36 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 37 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
www-data 38 0.0 0.0 95592 3868 ?  S 12:08 0:00 nginx: worker process 
root  55 0.0 0.0 8868 776 ?  S+ 12:14 0:00 grep --color=auto nginx 

aussi mon php-fpm7 fonctionne également sous forme www-data

/var/lib/nginx/appartenant également à www-data.

ls -l nginx 
total 20 
drwxrwxrwx 2 www-data www-data 4096 Aug 21 21:35 body 
drwxrwxrwx 2 www-data www-data 4096 Aug 21 21:35 fastcgi 
drwxrwxrwx 2 www-data www-data 4096 Aug 21 21:35 proxy 
drwxrwxrwx 2 www-data www-data 4096 Aug 21 21:35 scgi 
drwxrwxrwx 2 www-data www-data 4096 Aug 21 21:35 uwsgi 

limite de mémoire php est 512m limite du corps nginx est 100m

le serveur exécute usign docker.

Mon nginx.conf

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

events { 
    worker_connections 1024; 
} 

http { 
    sendfile on; 
    tcp_nopush on; 
    tcp_nodelay on; 
    keepalive_timeout 2; 
    client_max_body_size 100m; 
    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_protocols TLSv1 TLSv1.1 TLSv1.2; 
    ssl_prefer_server_ciphers on; 

    log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
      '$status $body_bytes_sent "$http_referer" ' 
      '"$http_user_agent" "$http_x_forwarded_for"'; 

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

    gzip on; 
    gzip_disable "MSIE [1-6].(?!.*SV1)"; 

    gzip_vary on; 
    gzip_proxied any; 
    gzip_min_length 1000; 
    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/conf.d/*.conf; 
    include /etc/nginx/sites-enabled/*; 
} 

Sortie de commande stat

stat /var/lib/nginx/fastcgi 
    File: '/var/lib/nginx/fastcgi' 
    Size: 4096  Blocks: 8   IO Block: 4096 directory 
Device: 40h/64d Inode: 140   Links: 2 
Access: (0777/drwxrwxrwx) Uid: (1000/www-data) Gid: ( 33/www-data) 
Access: 2016-08-30 11:30:16.268311861 +0000 
Modify: 2016-08-21 21:35:34.000000000 +0000 
Change: 2016-08-30 11:19:47.711701034 +0000 
Birth: - 

Que peut-être tort?

+0

Vous utilisez Chrome? Êtes-vous sûr que ce n'est pas un problème lié au cache? – Hackerman

+0

Pouvez-vous également publier le nom et la version de votre système d'exploitation? – Hackerman

+0

J'utilise posman pour tester les demandes. J'ai aussi essayé chrome et firefox. –

Répondre

3

Enfin corrigé en supprimant le répertoire/var/lib/nginx/fastcgi, puis en le recréant à partir de root et en changeant son propriétaire en www-data.

maintenant il ressemble que

drwxr-xr-x 2 www-data root  4096 Sep 5 13:58 fastcgi 

De plus, le problème pourrait être résolu en ajustant la taille de la mémoire tampon de FastCGI en utilisant ces paramètres de configuration:

fastcgi_buffers 16 16k; 
    fastcgi_buffer_size 32k;