initial commit
This commit is contained in:
13
third_party/libhv/etc/hmain_test.conf
vendored
Executable file
13
third_party/libhv/etc/hmain_test.conf
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
# [root]
|
||||
|
||||
# logfile = logs/test.log
|
||||
# loglevel = [VERBOSE,DEBUG,INFO,WARN,ERROR,FATAL,SILENT]
|
||||
loglevel = DEBUG
|
||||
log_remain_days = 3
|
||||
log_filesize = 16M
|
||||
|
||||
# worker_processes = auto # auto = ncpu
|
||||
worker_processes = auto
|
||||
worker_threads = 2
|
||||
|
||||
port = 8086
|
||||
54
third_party/libhv/etc/httpd.conf
vendored
Executable file
54
third_party/libhv/etc/httpd.conf
vendored
Executable file
@@ -0,0 +1,54 @@
|
||||
# [root]
|
||||
|
||||
# logfile = logs/httpd.log
|
||||
# loglevel = [VERBOSE,DEBUG,INFO,WARN,ERROR,FATAL,SILENT]
|
||||
loglevel = INFO
|
||||
log_remain_days = 3
|
||||
log_filesize = 64M
|
||||
|
||||
# multi-processes mode
|
||||
# auto = ncpu
|
||||
worker_processes = auto
|
||||
worker_threads = 1
|
||||
|
||||
# multi-threads mode
|
||||
# worker_processes = 1
|
||||
# worker_threads = auto
|
||||
|
||||
# Disable multi-processes mode for debugging
|
||||
# worker_processes = 0
|
||||
|
||||
# max_connections = workers * worker_connections
|
||||
worker_connections = 1024
|
||||
|
||||
# http server
|
||||
http_port = 8080
|
||||
https_port = 8443
|
||||
#base_url = /api/v1
|
||||
document_root = html
|
||||
home_page = index.html
|
||||
#error_page = error.html
|
||||
index_of = /downloads/
|
||||
keepalive_timeout = 75000 # ms
|
||||
limit_rate = 500 # KB/s
|
||||
access_log = off
|
||||
cors = true
|
||||
|
||||
# SSL/TLS
|
||||
ssl_certificate = cert/server.crt
|
||||
ssl_privatekey = cert/server.key
|
||||
ssl_ca_certificate = cert/cacert.pem
|
||||
|
||||
# proxy
|
||||
[proxy]
|
||||
proxy_connect_timeout = 10000 # ms
|
||||
proxy_read_timeout = 60000 # ms
|
||||
proxy_write_timeout = 60000 # ms
|
||||
# forward proxy
|
||||
forward_proxy = true
|
||||
trust_proxies = *httpbin.org;*postman-echo.com;*apifox.com
|
||||
#no_proxies = *
|
||||
# reverse proxy
|
||||
/httpbin/ => http://httpbin.org/
|
||||
/postman/ => http://postman-echo.com/
|
||||
/apifox/ => https://echo.apifox.com/
|
||||
37
third_party/libhv/etc/nginx.conf
vendored
Executable file
37
third_party/libhv/etc/nginx.conf
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
# cd libhv
|
||||
# sudo nginx -p . -c etc/nginx.conf
|
||||
# bin/httpd -c etc/httpd.conf -s restart -d
|
||||
# bin/curl -v http://127.0.0.1/api/v1/get
|
||||
|
||||
worker_processes auto;
|
||||
|
||||
pid logs/nginx.pid;
|
||||
error_log logs/error.log;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
access_log logs/access.log;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
# static files service
|
||||
location / {
|
||||
root html;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
# autoindex service
|
||||
location /downloads/ {
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
# api service: nginx => libhv
|
||||
location /api/v1/ {
|
||||
proxy_pass http://127.0.0.1:8080/;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user