Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

nginx + php-fpm70 getting 502 bad gateway

General Tech Bugs & Fixes

Max. 2000 characters
Tuteehub
Replies

usr_profile.png

User

( 6 months ago )

 

I'm Getting 502 bad gateway error in one of my magento2 site.

Here are my configuration files.

nginx.conf configuration file

    user  nginx;
worker_processes 4;
worker_rlimit_nofile 100000;
pid /var/run/nginx.pid;

events {
        use epoll;
#        worker_connections 1024;
    worker_connections 10240;
        multi_accept on;
}

http {
        include /etc/nginx/mime.types;
        default_type  application/octet-stream;
        access_log off;
        error_log /var/log/nginx/error.log warn;
        rewrite_log on;

    access_log  /var/log/nginx/access.log main buffer=32k flush=300;

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        autoindex off;
        server_tokens off;
        port_in_redirect off;

        open_file_cache max=10000 inactive=5m;
        open_file_cache_valid 2m;
        open_file_cache_min_uses 1;
        open_file_cache_errors on;

        types_hash_max_size 4096;

     client_header_buffer_size 16k;
     large_client_header_buffers 4 32k;

        fastcgi_send_timeout 3600;
        fastcgi_read_timeout 3600;
        fastcgi_buffers 8 256k;
        fastcgi_buffer_size 256k;
        fastcgi_connect_timeout 3600;

############
        client_max_body_size 1024M;
        client_body_buffer_size 128k;
        server_names_hash_max_size 1024;

        client_body_timeout 300;
        client_header_timeout 300;
    keepalive_timeout 600;
        keepalive_requests 100000;
        send_timeout 60;
        server_names_hash_bucket_size 128;

        gzip on;
        gzip_comp_level 6;
        gzip_http_version 1.0;
        gzip_proxied any;
        gzip_min_length 1100;
        gzip_buffers 16 8k;
        gzip_types any;
        gzip_types text/plain text/css application/octet-stream application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript text/x-javascript font/ttf application/font-woff font/opentype application/vnd.ms-fontobject image/svg+xml;

        gzip_disable “msie6”;
        gzip_vary on;

        include /etc/nginx/conf.d/*.conf;
}

php-fpm configure file

[domain.com.com]
listen = /var/run/php/domain.com-fpm.sock
listen.allowed_clients = 127.0.0.1

listen.owner = nginx
listen.group = nginx

user = domain_live
group = domain_live

; Choose how the process manager will control the number of child processes.
pm = dynamic
pm.max_children = 150
pm.start_servers = 60
pm.min_spare_servers = 50
pm.max_spare_servers = 90
pm.max_requests = 500

pm.status_path = /status

slowlog = /var/www/www.domain.com.com/logs/php-fpm-www-slow.log
rlimit_core = unlimited
php_admin_value[error_log] = /var/www/www.domain.com.com/logs/php-fpm-www-error.log
php_admin_flag[log_errors] = on

; Set session path to a directory owned by process user
php_value[session.save_handler] = files
php_value[session.save_path]     = /var/www/www.domain.com.com/application/var/session
php_value[soap.wsdl_cache_dir]  = /var/lib/php/wsdlcache

Getting below error logs

php-fpm error logs

WARNING: [pool domain.com] child 4314 exited on signal 11 (SIGSEGV - core dumped) after 4556.304032 seconds from start
NOTICE: [pool domain.com] child 6422 started

nginx error logs

2018/05/18 13:28:02 [error] 4247#4247: *1460 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 1.2.3.4, server: www.domain.com, request: "GET /checkout/cart/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/domain.com-fpm.sock:", host: "www.domain.com.com", referrer: "https://www.domain.com.com/customer/account/login/"

Please help to resolve this issue. As i'm already tried multiple ways to resolve issue but didn't get the success.

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif