Prevent nginx 504 Gateway timeout using PHP set_time_limit()

There are several ways in which you can set the timeout for php-fpm. In /etc/php5/fpm/pool.d/www.conf I added this line: request_terminate_timeout = 180 Also, in /etc/nginx/sites-available/default I added the following line to the location block of the server in question: fastcgi_read_timeout 180; The entire location block looks like this: location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index … Read more

413 Request Entity Too Large – File Upload Issue

Source: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/ Edit the conf file of nginx: nano /etc/nginx/nginx.conf Add a line in the http, server or location section: client_max_body_size 100M; Doen’t use MB it will not work, only the M! Also do not forget to restart nginx systemctl restart nginx

Default nginx client_max_body_size

The default value for client_max_body_size directive is 1 MiB. It can be set in http, server and location context — as in the most cases, this directive in a nested block takes precedence over the same directive in the ancestors blocks. Excerpt from the ngx_http_core_module documentation: Syntax: client_max_body_size size; Default: client_max_body_size 1m; Context: http, server, … Read more

SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

Once you have established that they don’t match, you still have a problem — what to do about it. Often, the certificate may merely be assembled incorrectly. When a CA signs your certificate, they send you a block that looks something like —–BEGIN CERTIFICATE—– MIIAA-and-a-buncha-nonsense-that-is-your-certificate -and-a-buncha-nonsense-that-is-your-certificate-and- a-buncha-nonsense-that-is-your-certificate-and-a-bun cha-nonsense-that-is-your-certificate-and-a-buncha-n onsense-that-is-your-certificate-AA+ —–END CERTIFICATE—– they’ll also send you … Read more

nginx server_name wildcard or catch-all

Change listen option to this in your catch-all server block. (Add default_server) this will take all your non-defined connections (on the specified port). listen 80 default_server; if you want to push everything to index.php if the file or folder does not exist; try_files $uri /$uri /index.php; Per the docs, It can also be set explicitly … Read more

Why is nginx responding to any domain name?

The first server block in the nginx config is the default for all requests that hit the server for which there is no specific server block. So in your config, assuming your real domain is REAL.COM, when a user types that in, it will resolve to your server, and since there is no server block … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)