summarylogtreecommitdiffstats
path: root/.rr.yaml.sample-full
blob: 5bd586f81f277f0105060bc1f1b3b39270ac4a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# defines environment variables for all underlying php processes
env:
	key: value

# rpc bus allows php application and external clients to talk to rr services.
rpc:
	# enable rpc server
	enable: true

	# rpc connection DSN. Supported TCP and Unix sockets.
	listen:     tcp://127.0.0.1:6001

metrics:
	# prometheus client address (path /metrics added automatically)
	address: localhost:2112
	collect:
		app_metric:
			type:    histogram
			help:    "Custom application metric"
			labels:  ["type"]
			buckets: [0.1, 0.2, 0.3, 1.0]

# http service configuration.
http:
	# http host to listen.
	address: 0.0.0.0:8080

	ssl:
		# custom https port (default 443)
		port:     443

		# force redirect to https connection
		redirect: true

		# ssl cert
		cert:     server.crt

		# ssl private key
		key:      server.key

		# rootCA certificate path
		rootCa:   root.crt

	# HTTP service provides FastCGI as frontend
	fcgi:
		# FastCGI connection DSN. Supported TCP and Unix sockets.
		address: tcp://0.0.0.0:6920

	# HTTP service provides HTTP2 transport
	http2:
		# enable HTTP/2, only with TLS
		enabled: true

		# to enable H2C on TCP connections, false by default
		h2c: true

		# max transfer channels
		maxConcurrentStreams: 128

	# max POST request size, including file uploads in MB.
	maxRequestSize: 200

	# file upload configuration.
	uploads:
		# list of file extensions which are forbidden for uploading.
		forbid: [".php", ".exe", ".bat"]

	# cidr blocks which can set ip using X-Real-Ip or X-Forwarded-For
	trustedSubnets: ["10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "::1/128", "fc00::/7", "fe80::/10"]

	# http worker pool configuration.
	workers:
		# php worker command.
		command:  "php psr-worker.php pipes"

		# User under which process will be started. To use this feature RR needs to be run under the root
		# https://www.man7.org/linux/man-pages/man7/user_namespaces.7.html
		user: ""

		# connection method (pipes, tcp://:9000, unix://socket.unix). default "pipes"
		relay:    "pipes"

		# worker pool configuration.
		pool:
			# number of workers to be serving.
			numWorkers: 4

			# maximum jobs per worker, 0 - unlimited.
			maxJobs:  0

			# for how long worker is allowed to be bootstrapped.
			allocateTimeout: 60

			# amount of time given to the worker to gracefully destruct itself.
			destroyTimeout:  60

# Additional HTTP headers and CORS control.
headers:
	# Middleware to handle CORS requests, https://www.w3.org/TR/cors/
	cors:
		# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
		allowedOrigin: "*"

		# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers
		allowedHeaders: "*"

		# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
		allowedMethods: "GET,POST,PUT,DELETE"

		# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
		allowCredentials: true

		# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers
		exposedHeaders: "Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma"

		# Max allowed age in seconds
		maxAge: 600

	# Automatically add headers to every request passed to PHP.
	request:
		"Example-Request-Header": "Value"

	# Automatically add headers to every response.
	response:
		"X-Powered-By": "RoadRunner"

# monitors rr server(s)
limit:
	# check worker state each second
	interval: 1

	# custom watch configuration for each service
	services:
		# monitor HTTP workers
		http:
			# maximum allowed memory consumption per worker (soft)
			maxMemory: 100

			# maximum time to live for the worker (soft)
			TTL: 0

			# maximum allowed amount of time worker can spend in idle before being removed (for weak db connections, soft)
			idleTTL: 0

			# max_execution_time (brutal)
			execTTL: 60

# static file serving. remove this section to disable static file serving.
static:
	# root directory for static file (HTTP would not serve .php and .htaccess files).
	dir:   "public"

	# list of extensions for forbid for serving.
	forbid: [".php", ".htaccess"]

	# Automatically add headers to every request.
	request:
		"Example-Request-Header": "Value"

	# Automatically add headers to every response.
	response:
		"X-Powered-By": "RoadRunner"

# health service configuration
health:
	# http host to serve health requests.
	address: localhost:2113

reload:
	# enable or disable file watcher
	enabled: true
	# sync interval
	interval: 1s
	# global patterns to sync
	patterns: [".php"]
	# list of included for sync services
	services:
		http:
			# recursive search for file patterns to add
			recursive: true
			# ignored folders
			ignore: ["vendor"]
			# service specific file pattens to sync
			patterns: [".php", ".go",".md",]
			# directories to sync. If recursive is set to true, 
			# recursive sync will be applied only to the directories in `dirs` section
			dirs:     ["."]
		jobs:
			recursive: false
			ignore:   ["service/metrics"]
			dirs:     ["./jobs"]
		rpc:
			recursive: true
			patterns: [".json"]
			# to include all project directories from workdir, leave `dirs` empty or add a dot "."
			dirs:     [""]