Public Repository

Last pushed: 2 months ago
Short Description
tengine2.2 + rtmp +googleSpeed插件
Full Description

tengine2.2 + rtmp +googleSpeed插件

启动
sudo docker run -p 9000:9000 -v /data/zjy/nginx.conf:/etc/nginx/nginx.conf -d coolzlay/tengine:1.0

参考配置文件:
user root;
worker_processes 2;
worker_cpu_affinity auto;
pid /run/nginx.pid;

worker_rlimit_nofile 100000;
events {
use epoll;
worker_connections 1024;
multi_accept on;
}

http {

##
# Basic Settings
##

open_file_cache max=204800 inactive=20s; 
open_file_cache_min_uses 1; 
open_file_cache_valid 30s; 

server_tokens off;
server_info off;
server_tag off;


sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
#types_hash_max_size 2048;
# server_tokens off;

server_names_hash_bucket_size 128;
# server_name_in_redirect off;



client_header_buffer_size 20k; 
large_client_header_buffers 4 32k; 
client_max_body_size 1000m; 

proxy_connect_timeout 1800;  
proxy_read_timeout    1800;
proxy_send_timeout    1800; 

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

#ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
#ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";


#gzip_min_length  1k;
#gzip_buffers     4 16k;
#gzip_http_version 1.0;
#gzip_comp_level 2;
#gzip_types       text/plain application/x-javascript text/css application/xml;
#gzip_vary 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 128k;

##
# DDoS Protection Settings
##
limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=50r/s;
limit_conn conn_limit_per_ip 20;
limit_req zone=req_limit_per_ip burst=20;


##
# Virtual Host Configs
##
#include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;

# tomcat 集群负载
#upstream  backend
#{
#server 192.168.10.180:8881 weight=1; 
#server 192.168.10.180:8882 weight=1; 
#server 192.168.10.180:8883 weight=1; 

#    check interval=3000 rise=2 fall=5 timeout=1000 type=http;
#       check_keepalive_requests 100;
#      check_http_send "HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n";
#        check_http_expect_alive http_2xx http_3xx;

# ip_hash;  
#}

#设定虚拟主机
server {

listen 9000;
server_name localhost;

pagespeed on;
pagespeed FileCachePath /var/nginx/ngx_pagespeed_cache;


    # 启用压缩空白过滤器
    pagespeed EnableFilters collapse_whitespace;
# 延时加载客户端看不见的图片
    pagespeed EnableFilters lazyload_images;
# 启用JavaScript缩小机制
    pagespeed EnableFilters rewrite_javascript;
    # 启用图片优化机制
    pagespeed EnableFilters rewrite_images;
# 预解析DNS查询
    pagespeed EnableFilters insert_dns_prefetch;
# 重写CSS,首先加载渲染页面的CSS规则
pagespeed EnableFilters prioritize_critical_css;



location /my_status {
        check_status;

        access_log   off;
        allow all;
    #    deny all;
    }

 location / {
        index   index.html index.php;
 }
  #对 / 所有做负载均衡 (本机nginx采用完全转发,所有请求都转发到后端的tomcat集群)
   #location / {
 #      trim on;
 #      trim_js on;
 #       trim_css on;     
 #
 #        proxy_pass  http://backend;
    #保留用户真实信息
#          proxy_redirect  off;    
 #         proxy_set_header Host $host;
  #        proxy_set_header   Referer $http_referer;
   #       proxy_set_header  X-Real-IP  $remote_addr;
    #      proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    #      proxy_set_header   Cookie $http_cookie;  
     #     proxy_http_version 1.1;
     #     proxy_set_header Upgrade $http_upgrade;
     #     proxy_set_header Connection "upgrade";
#}

}

}

Docker Pull Command
Owner
coolzlay

Comments (0)