Nginx shows error page from time to time

I am running a VPS on digitalocean. I have daily traffic of 500 unique users. I was having CPU and RAM utilization problems on Apache. Now I am using Nginx because it's lightweight. My CPU and RAM is under control but still Nginx shows an error message from time to time, which I believe is due to load/wrong configuration.

I am getting this error in my log files:

ngx_slab_alloc() failed: no memory in SSL session

I have the following configuration for my nginx server:

keepalive_timeout 20;
ssl_session_timeout 7200m;
ssl_session_cache shared:SSL:150m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;

What is the right configuration for me, considering I am running a VPS with 1Gb RAM?

Would using a database sessions table (as in Laravel) solve my problem, independent from the Nginx configuration?

2

1 Answer

Reduce ssl_session_timeout and ssl_session_cache values. Please check the link for nginx https server configuration and server optimization.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like