Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
snail007
GitHub Repository: snail007/goproxy
Path: blob/master/rhttp.toml
684 views
1
# minimal example
2
[[host]]
3
bind="http://demo.com/"
4
target="https://127.0.0.1:9090/"
5
upstream="127.0.0.1:9090"
6
7
# example: http to https
8
#[[host]]
9
#bind="https://localhost"
10
#tlscert="default"
11
#target="http://www.baidu.com/"
12
#upstream="www.baidu.com:80"
13
#timeout=3000
14
15
# example: http to http
16
#[[host]]
17
#bind="http://demo.com"
18
#target="http://www.baidu.com/path/"
19
#upstream="www.baidu.com:80"
20
#timeout=3000
21
22
# example: https to https
23
#[[host]]
24
#bind="https://demo.com"
25
#tlscert="proxy.crt"
26
#tlskey="proxy.key"
27
#target="https://www.baidu.com/"
28
#upstream="www.baidu.com:443"
29
#timeout=3000
30
31
######################################################################
32
# All configuration keys of section [[host]].
33
# A [[host]] is a section.
34
# You can set multiple [[host]] for the different binding.
35
######################################################################
36
#[[host]]
37
38
######################################################################
39
# 1.listen on http or https port in url,
40
# default http port is 80, https defalt https port is 443.
41
# 2.multiple binding elements split by space.
42
######################################################################
43
#bind="https://demo.com/ http://demo2.com/"
44
45
######################################################################
46
# 1.the binding is https, you can set the certificate and key file.
47
# 2.tlscert is the https certificate file.
48
# 3.tlskey is the https certificate key file.
49
######################################################################
50
#tlscert="proxy.crt"
51
#tlskey="proxy.key"
52
53
######################################################################
54
# 1.all requests to binding url will send to the target url.
55
# 2.you can set the target path FOO_PATH, or leave it empty.
56
# 3.the finally path send to taget is "/FOO_PATH/PATH", PATH is
57
# bind-path, if not set, it is empty.
58
# 4.the HOST HTTP header send to upstream is the host in target url.
59
######################################################################
60
#target="https://demo.com/FOO_PATH"
61
62
######################################################################
63
# 1.you can set multiple upstreams.
64
# 2.proxy will select one upstream by the --lb-method rule.
65
# 3.multiple upstreams separated by space.
66
# 4.upstream host can be ip or domain, format is HOST:PORT.
67
######################################################################
68
#upstream="10.0.0.10:443 app.com:443"
69
70
######################################################################
71
# 1.you can set some path access forbidden.
72
# 2."403 path" regex expression supported.
73
# 3.you can set mutiple path, it is a path array.
74
######################################################################
75
#403=["/admin","/auth","^/user/.*html$"]
76
77
######################################################################
78
# 1.you can set the timeout milliseconds connect to target.
79
# 2."403 path" regex expression supported.
80
# 3.you can set mutiple path, it is a path array.
81
######################################################################
82
#timeout=3000
83
84
##########################################################################
85
# 1.you can set the alias name of binding.
86
# 2.the first element is bind to, it should be one element of bind value.
87
# 3.the else elements are alias host names, name format is HOST:PORT, it
88
# will be set in the HTTP header HOST send to the upstream.
89
##########################################################################
90
#bind-alias=["https://demo.com www.foo.com:443"]
91
92
######################################################################
93
# 1.the request's path must be has a prefix in the bind-path array.
94
#bind-path=["/PATH"]
95
96
97
98