text [nginx配置] #webserver

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text [nginx配置] #webserver相关的知识,希望对你有一定的参考价值。

user www-data;
worker_processes 2;
pid /var/run/nginx.pid;
 
events {
    worker_connections 768;
    multi_accept on;
    use epoll;
}
 
http {
 
    # Let NGINX get the real client IP for its access logs
    set_real_ip_from 127.0.0.1;
    real_ip_header X-Forwarded-For;
 
    # Basic Settings
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 20;
    client_max_body_size 15m;
    client_body_timeout 60;
    client_header_timeout 60;
    client_body_buffer_size  1K;
    client_header_buffer_size 1k;
    large_client_header_buffers 4 8k;
    send_timeout 60;
    reset_timedout_connection on;
    types_hash_max_size 2048;
    server_tokens off;
 
    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;
 
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
 
    # Logging Settings
    # access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
 
    # Log Format
    log_format main '$remote_addr - $remote_user [$time_local] '
    '"$request" $status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
 
    # Gzip Settings
    gzip on;
    gzip_static on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_min_length 512;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/css text/javascript text/xml text/plain text/x-component 
    application/javascript application/x-javascript application/json 
    application/xml  application/rss+xml font/truetype application/x-font-ttf 
    font/opentype application/vnd.ms-fontobject image/svg+xml;
 
    # Virtual Host Configs
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
types {
	..
	application/vnd.ms-fontobject           eot;
	application/x-font-ttf                  ttf;
	font/opentype                           ott;
	application/font-woff                   woff;
	..
}

以上是关于text [nginx配置] #webserver的主要内容,如果未能解决你的问题,请参考以下文章

Linux (centos )下Nginx+PHP+MySQL配置——自己的lnmp配置

Nginx配置入门

nginx和apache作为webserver的差别

学习总结快速上手Linux玩转典型应用-第7章-WebServer安装和配置讲解

nginx 实现简单的负载均衡搭建

nginx+tomcat集群配置---获取真实客户端IP