worker_processes  2;  ## 默认1，一般建议设成CPU核数1-2倍

events {
    worker_connections  2048;
}

http {
    client_max_body_size 1024m;

    default_type application/octet-stream;  # 默认文件类型

    # 日志格式及access日志路径
    log_format   main '$remote_addr - $remote_user [$time_local]  $status '
    '"$request" $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    sendfile     on;
    tcp_nopush   on; # sendfile开启时才开启。

    proxy_connect_timeout 900; #单位秒
    proxy_send_timeout 900; #单位秒
    proxy_read_timeout 900; #单位秒

    server {
        listen       80;
        proxy_hide_header 'Access-Control-Allow-Origin';
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Allow-Methods' '*' always;
        add_header 'Access-Control-Allow-Headers' '*';
        location / {
            proxy_pass https://www.youtube.com/;
        }
    }
}
