D
D
Djadka Maxho2015-04-23 08:55:54
Nginx
Djadka Maxho, 2015-04-23 08:55:54

What settings should be registered so that Nginx on Mac does not issue 502, periodically?

Nginx version 1.6 periodically crashes on 502. Solutions with increasing buffer memory on fastcgi did not help. The same problem exists on the site where nginx acts as a balancer, there are also periodic crashes, PHP does not crash in this case, and even the request is not proxied further after the balancer.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Samilko, 2015-04-25
@Djadka

You have a problem with the backend not being able to accept more connections from the client. Scale up the backend, roll up the keepalive. Set up backend monitoring. Post your config for more specific advice.

S
sim3x, 2015-04-23
@sim3x

Replace fastcgi with wsgi

D
Djadka Maxho, 2015-04-27
@Djadka

The config is standard out of the box, the only thing that has changed is the number of workers. Having smoked logs, there 502 was only on poppies and iPhones.
nginx.conf

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;
          fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;

        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 9;
        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;

location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param HTTPS on;
                fastcgi_param  HTTP_X_REAL_IP   $remote_addr;
                include fastcgi_params;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question