Advance setup of #nginx, compression, timeout, ip filter, etc.



#fanaticus #advancenginx
Nginx Advance setup explained.
How to add compression in nginx
gzip on;
gzip_vary on;
gzip_min_length 100;
gzip_comp_level 5;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/x-javascript application/javascript text/xml text/css application/xml image/png image/jpg image/svg+xml;
gzip_buffers 16 8k;
gzip_disable “MSIE [1-6].(?!.*SV1)”;

The level of gzip compression simply determines how compressed the data is on a scale from 1-9, where 9 is the most compressed. The trade-off is that the most compressed data usually requires the most work to compress/decompress, so if you have it set fairly high on a high-volume website, you may feel its effect.

0 55.38 KiB (100.00% of original size)
1 11.22 KiB ( 20.26% of original size)
2 10.89 KiB ( 19.66% of original size)
3 10.60 KiB ( 19.14% of original size)
4 10.17 KiB ( 18.36% of original size)
5 9.79 KiB ( 17.68% of original size)
6 9.62 KiB ( 17.37% of original size)
7 9.50 KiB ( 17.15% of original size)
8 9.45 KiB ( 17.06% of original size)
9 9.44 KiB ( 17.05% of original size)

How to increase the client file upload size
client_max_body_size 1m

How to limit the request based on client IP
limit_req_zone $binary_remote_addr zone=speedbump:1m rate=10r/s;

How to set timeout setting in nginx reverse proxy
proxy_read_timeout 60s;
proxy_connect_timeout 120s;
proxy_send_timeout 120s;

How to View nginx logs
less /var/log/nginx/access.log
tail -f /var/log/nginx/error.log

#subscribe #newvideo
Download This Video

(Visited 1 times, 1 visits today)
treehoster
Author: treehoster

Share This Post
Have your say!
00