Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #D I E T - P I
- # /etc/nginx/nginx.conf
- user www-data;
- # As a thumb rule: One per CPU.
- worker_processes 4;
- # Maximum file descriptors that can be opened per process
- # This should be > worker_connections
- worker_rlimit_nofile 20;
- events {
- worker_connections 10;
- }
- error_log /var/log/nginx/error.log;
- pid /run/nginx.pid;
- http {
- client_max_body_size 32m;
- charset utf-8;
- # Upstream to abstract back-end connection(s) for PHP
- upstream php {
- server unix:/run/php5-fpm.sock;
- }
- # Set the mime-types via the mime.types external file
- include mime.types;
- # And the fallback mime-type
- default_type application/octet-stream;
- # Click tracking!
- access_log off;
- # Hide nginx version
- server_tokens off;
- # ~2 seconds is often enough for HTML/CSS, but connections in
- # Nginx are cheap, so generally it's safe to increase it
- keepalive_timeout 2;
- # You usually want to serve static files with Nginx
- sendfile on;
- tcp_nopush on; # off may be better for Comet/long-poll stuff
- tcp_nodelay off; # on may be better for Comet/long-poll stuff
- server_name_in_redirect off;
- types_hash_max_size 2048;
- gzip off;
- gzip_http_version 1.0;
- gzip_comp_level 1;
- gzip_min_length 512;
- gzip_buffers 4 8k;
- gzip_proxied any;
- gzip_types
- # text/html is always compressed by HttpGzipModule
- text/css
- text/plain
- text/x-component
- application/javascript
- application/json
- application/xml
- application/xhtml+xml
- application/x-font-ttf
- application/x-font-opentype
- application/vnd.ms-fontobject
- image/svg+xml
- image/x-icon;
- # This should be turned on if you are going to have pre-compressed copies (.gz) of
- # static files available. If not it should be left off as it will cause extra I/O
- # for the check. It would be better to enable this in a location {} block for
- # a specific directory:
- # gzip_static on;
- gzip_disable "msie6";
- gzip_vary on;
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement