2019-04-23 04:14:27 +00:00
|
|
|
http {
|
|
|
|
server {
|
2019-04-26 06:48:49 +00:00
|
|
|
server_name *.etherdream.com;
|
|
|
|
ssl_certificate cert/etherdream.com/ecc.cer;
|
|
|
|
ssl_certificate_key cert/etherdream.com/ecc.key;
|
|
|
|
listen 8443 ssl http2;
|
2019-04-23 04:14:27 +00:00
|
|
|
include api.conf;
|
|
|
|
}
|
2019-04-26 03:15:48 +00:00
|
|
|
resolver 1.1.1.1 ipv6=off;
|
2019-04-23 04:14:27 +00:00
|
|
|
resolver_timeout 10s;
|
|
|
|
|
|
|
|
keepalive_timeout 60;
|
|
|
|
keepalive_requests 2048;
|
|
|
|
server_tokens off;
|
|
|
|
underscores_in_headers on;
|
|
|
|
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
2019-04-26 07:30:30 +00:00
|
|
|
ssl_ciphers TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-AES-128-GCM-SHA256:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
|
|
|
|
ssl_session_timeout 1d;
|
|
|
|
ssl_session_cache shared:SSL:30m;
|
2019-04-23 04:14:27 +00:00
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
|
|
|
|
limit_req_log_level warn;
|
|
|
|
limit_req_zone $binary_remote_addr zone=reqip:16m rate=100r/s;
|
|
|
|
limit_req zone=reqip burst=200 nodelay;
|
|
|
|
|
|
|
|
# separated by tab (\t)
|
|
|
|
log_format log_proxy escape=none
|
2019-04-26 03:15:48 +00:00
|
|
|
'$time_iso8601 $_origin_id $_ver $remote_addr '
|
|
|
|
'$upstream_cache_status $request_time '
|
2019-04-23 04:14:27 +00:00
|
|
|
'$request_length $bytes_sent '
|
|
|
|
'$request_method $_url $status $upstream_http_access_control_allow_origin '
|
|
|
|
'$http_user_agent'
|
|
|
|
;
|
|
|
|
access_log logs/proxy.log log_proxy buffer=64k flush=1s;
|
|
|
|
|
|
|
|
proxy_cache_path cache
|
|
|
|
levels=1:2
|
2019-04-29 09:34:14 +00:00
|
|
|
keys_zone=my_cache:32m
|
|
|
|
max_size=20g
|
|
|
|
inactive=24h
|
2019-04-23 04:14:27 +00:00
|
|
|
use_temp_path=off
|
|
|
|
;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_ssl_server_name on;
|
|
|
|
|
|
|
|
proxy_buffer_size 16k;
|
|
|
|
proxy_buffers 4 32k;
|
|
|
|
proxy_busy_buffers_size 64k;
|
|
|
|
proxy_send_timeout 10s;
|
|
|
|
|
2019-04-29 09:34:14 +00:00
|
|
|
# traffic statistics
|
|
|
|
lua_shared_dict traff 16k;
|
|
|
|
|
|
|
|
lua_package_path ./lua/?.lua;
|
|
|
|
init_by_lua_file ../lua/init.lua;
|
|
|
|
init_worker_by_lua_file ../lua/worker.lua;
|
|
|
|
log_by_lua require('g').inc();
|
|
|
|
|
2019-04-26 03:15:48 +00:00
|
|
|
map $http_origin $_origin_id {
|
2019-04-26 06:41:07 +00:00
|
|
|
include allowed-sites.conf;
|
2019-04-23 04:14:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 4096;
|
|
|
|
}
|