Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www-data;
- worker_processes 8;
- worker_rlimit_nofile 100000;
- pid /var/run/nginx.pid;
- events {
- worker_connections 1024;
- multi_accept on;
- use epoll;
- }
- http {
- index index.html index.php;
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" ';
- log_format error403 '$remote_addr - [$time_local] "$request"';
- keepalive_timeout 5;
- server_tokens off;
- port_in_redirect off;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- ## Flood protection example
- limit_req_zone $binary_remote_addr zone=search:25m rate=1r/s;
- limit_req_zone $binary_remote_addr zone=account:25m rate=1r/s;
- limit_req_zone $binary_remote_addr zone=checkout:25m rate=1r/s;
- ## Cache open FD
- open_file_cache max=10000 inactive=3600s;
- open_file_cache_valid 7200s;
- open_file_cache_min_uses 2;
- ## Gzipping is an easy way to reduce page weight
- gzip on;
- gzip_disable "msie6";
- gzip_vary on;
- gzip_http_version 1.0;
- gzip_comp_level 6;
- gzip_min_length 1100;
- gzip_buffers 16 8k;
- gzip_types text/plain text/xml application/xml application/xml+rss application/atom+xml image/svg+xml font/opentype application/x-font-ttf application/vnd.ms-fontobject text/css text/javascript application/javascript application/x-javascript application/json
- gzip_proxied expired no-cache no-store private auth;
- gzip_static on;
- # Proxy global options
- proxy_buffering off;
- proxy_cache_min_uses 3;
- proxy_cache_path /etc/nginx/proxy_temp/ levels=1:2 keys_zone=cache:10m inactive=10m max_size=1000M;
- #proxy_cache_valid any 1m;
- proxy_ignore_client_abort off;
- proxy_intercept_errors on;
- proxy_next_upstream error timeout invalid_header;
- proxy_redirect off;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_connect_timeout 60;
- proxy_send_timeout 60;
- proxy_read_timeout 60;
- ## Use when Varnish in front
- #set_real_ip_from 127.0.0.1;
- #real_ip_header X-Forwarded-For;
- ## Map status to exclude from access log
- map $status $writelog { 404 0; 410 0; 444 0; default 1; }
- ## Main domain configuration
- include /etc/nginx/sites-enabled/*.conf;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement