Answer the question
In order to leave comments, you need to log in
Strange behavior of nginx + php7.0-fpm on Ubuntu 16.04. What could it be?
Oddities are manifested in the following:
- the site works for some time, the time is always different, it works quite quickly and without problems
- after some time *26481 recv() failed (104: Connection reset by peer) while reading response header from upstream by logs Nginxa
- reboot php-fpm and everything starts working fine again until next time
host configs in nginx
server {
listen 80;
server_name ;
return 301 https://$server_name$request_uri;
}
server {
charset utf-8;
client_max_body_size 128M;
autoindex on;
server_tokens off;
listen 443 ssl;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=15768000";
ssl_stapling on;
ssl_stapling_verify on;
location / {
try_files $uri $uri/ /index.php?$args;
proxy_connect_timeout 300;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffer_size 64k;
proxy_buffers 16 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_pass_header Set-Cookie;
proxy_redirect off;
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
proxy_ignore_headers Cache-Control Expires;
proxy_set_header Referer $http_referer;
proxy_set_header Host $host;
proxy_set_header Cookie $http_cookie;
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;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 300;
}
#ENABLE GZIP
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
gzip_comp_level 5;
#ENABLE BROWSER CACHE
location ~* ^.+\.(woff|rss|atom|jpg|jpeg|gif|png|ico|rtf)$ {
expires max;
}
location ~ /.well-known {
allow all;
}
}
;listen = /run/php/php7.0-fpm.sock
listen = 127.0.0.1:9000
Answer the question
In order to leave comments, you need to log in
the question was closed. found the shit code of one of the developers, which looped the backend, as a result of which there was no exit from the procedure and fpm did not understand what to do. thank you all for your attention
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question