您的位置:首页 > 运维架构 > Nginx

nginx设置

2019-03-25 10:27 417 查看

http
    {
        include       mime.types;
        default_type  application/octet-stream;

        server_names_hash_bucket_size 128;
        client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 50m;

        sendfile   on;
        tcp_nopush on;

        keepalive_timeout 600;#为了本地调试设置大一点,原来是60

        tcp_nodelay on;

        #fastcgi_connect_timeout 300;
        #fastcgi_send_timeout 300;
        #fastcgi_read_timeout 300;
        #fastcgi_buffer_size 64k;
        #fastcgi_buffers 4 64k;
        #fastcgi_busy_buffers_size 128k;
        #fastcgi_temp_file_write_size 256k;
        send_timeout 5;
        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
        gzip_disable   "MSIE [1-6]\.";

        #limit_conn_zone $binary_remote_addr zone=perip:10m;
        ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

        server_tokens off;
        access_log off;

server
    {
        listen 8889;
        #listen [::]:80 default_server ipv6only=on;
        server_name dev.测试.com;
        include /usr/local/nginx/conf/ssl/测试.com/ssl.conf;
        index index.html index.htm index.php;
        access_log /home/log/nginx/dev.测试.com_nginx.log;
        root  /home/wwwroot/default;

        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
        # proxy_pass http://192.168.47.101:8080;
          proxy_pass http://192.168.47.107:8080;
         # proxy_pass http://192.168.21.38:8686;
           expires      2h;
        }

        location ~ .*\.(js|css)?$
        {
       # proxy_pass http://192.168.47.101:8080;
         proxy_pass http://192.168.47.107:8080;
         # proxy_pass http://192.168.21.38:8686;
         expires      2h;
         # add_header Cache-Control no-cache;

        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }
        location ~ .*\.(js|css)?$
        {
       # proxy_pass http://192.168.47.101:8080;
         proxy_pass http://192.168.47.107:8080;
         # proxy_pass http://192.168.21.38:8686;
         expires      2h;
         # add_header Cache-Control no-cache;

        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }


#location = / {
#       rewrite ^/(.*) /auth ;
#}

location / {
        #root   /usr/local/tp_upload;
       # index  index.html index.htm;
       proxy_set_header Host $host;

      # proxy_set_header X-Real-IP $remote_addr;

      #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

      #proxy_set_header X-Forwarded-Proto $scheme;


       # proxy_pass http://192.168.47.101:8080;
       proxy_pass http://192.168.47.107:8080;
       #check test:proxy_pass http://192.168.32.113:8091;
        #client_max_body_size 1000m;
      # try_files $uri $uri/ /index.html;

    }


        access_log  /home/wwwlogs/access.log;
    }
include vhost/*.conf;
}
 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Nginx FastCGI