Skip to content

Commit

Permalink
fix #375 rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Lvov committed Apr 12, 2016
1 parent d90005d commit e646774
Showing 1 changed file with 248 additions and 6 deletions.
254 changes: 248 additions & 6 deletions etc/tempesta_fw.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,248 @@
cache 0;
listen 8081;
server 127.0.0.1:80;
frang_limits{
http_uri_len 3;
}
#
# Tempesta FW configuration file.
#

# TAG: sched.
#
# Specifies the scheduler used to distribute load among servers
#
# Syntax:
# sched SCHED_NAME;
#
# Currently recognized schedulers are:
# - hash
# - round-robin
#
# If not specified, SCHED_NAME defaults to round-robin.
#
# The specified scheduler affects all server definitions that are missing
# a scheduler definition. If a srv_group is missing a scheduler definition,
# and a scheduler is specified, then that scheduler is set for the group.
# Also, if servers outside of any groups are specified, then they form
# a special group, and the specified scheduler is assigned to that group.
#
# Multiple "sched" directives may be specified in the configuration file.
# Each directive affects servers groups that follow it.
#

# TAG: server.
#
# Specifies an IP address/port of a back-end HTTP server.
#
# Syntax:
# server IPADDR[:PORT] [conns_n=N]
#
# IPADDR may be either IPv4 or IPv6 address, hostnames are not allowed.
# IPv6 address must be enclosed in square brackets (e.g. "[::0]" but not "::0").
# PORT defaults to 80 if not set.
#
# conns_n=N is the number of parallel connections to the server.
# The N defaults to 4 if not set.
#
# Multiple back-end servers may be specified, for example:
# server 10.1.0.1:80
# server [fc00::1]:80;
#

# TAG: srv_group
#
# Groups multiple backend servers into a single unit of load balancing.
# All backend servers within a group are treated as interchangeable.
# The load is distributed evenly over all servers within a single group.
# If some server goes offline, other members of the group take its load.
#
# Syntax:
# srv_group NAME [sched=SCHED_NAME] {
# server IPADDR[:PORT] [conns_n=N];
# ...
# }
#
# NAME is a unique identifier of the group that may be used to refer it later.
#
# SCHED_NAME is a name of a scheduler module that distributes load among servers
# within the group. There are three schedulers available:
# - "round-robin" (default) - rotates all servers in the group in
# the round-robin manner, so requests are distributed uniformely across
# servers.
# - "hash" - chooses a server based on a URI/Host hash of a request.
# Requests are still distributed uniformely, but a request with the same
# URI/Host is always sent to the same server.
#
# Note that HTTP scheduler dispatches message among server groups only and
# round-robin or hash scheduler must be used to select a server in a group.
#
# IPADDR[:PORT] is the IPv4 or IPv6 address of the server (see: server).
# conns_n=N is the number of parallel connections to the server (see: server).
#
# Examples:
# srv_group static_storage sched=hash {
# server 10.10.0.1:8080;
# server 10.10.0.2:8080;
# server [fc00::3]:8081 conns_n=1;
# }
#
# Default:
# There is a special group called "default". All "server" entries defined
# outside an "srv_group" added to the default group implicitly.

# TAG: listen
#
# Tempesta FW listening address.
#
# Syntax:
# listen PORT | IPADDR[:PORT]
#
# IPADDR may be either an IPv4 or IPv6 address, no host names allowed.
# IPv6 address must be enclosed in square brackets (e.g. "[::0]" but not "::0").
#
# If only PORT is given, then the address 0.0.0.0 (but not [::1]) is used.
# If only IPADDR is given, then the default HTTP port 80 is used.
#
# Tempesta FW opens one socket for each 'listen' entry, so it may be repeated
# to listen on multiple addresses/ports. For example:
# listen 80;
# listen [::0]:80;
# listen 127.0.0.1:8001;
# listen [::1]:8001;
#
# Default:
# listen 80;

# TAG: cache
#
# Boolean value to enable or disable Web content caching.
# It can be useful to switch caching off to run Tempesta on the same host as
# protected HTTP accelerator.
#
# Syntax:
# cache on | off
#
# Default:
# cache on;

# TAG: cache_db
#
# Path to a cache database used as a storage for Tempesta FW Web cache.
#
# Syntax:
# cache_db PATH
#
# The PATH must be absolute and the directory must exist.
# Also, the PATH should not end with a slash (e.g. "/foo/bar/").
#
# Spaces and other special characters must be escaped with a backslash.
# Alternatively, the whole path may be enclosed to double quotes.
# For example:
# cache_dir /var/foo\ bar\ baz;
# cache_dir "/var/weird !;% name";
#
# Default:
# cache_db /opt/tempesta/db/cache.tdb;

# TAG: cache_size
#
# Size of file(s) created by Tempesta FW within cache_dir.
#
# Syntax:
# cache_size SIZE
#
# SIZE is specified in bytes, suffixes like 'MB' are not supported yet.
# Also, the number must be a multiple of 4096 (page size).
#
# Default:
# cache_size 268435456; # 256MB

# TAG: filter_db
#
# Path to a filter database file used as a storage for Tempesta FW filter rules.
# The same as cache_db.
#
# Default:
# filter_db /opt/tempesta/db/filter.tdb;

# TAG: drop_tbl_size
#
# Size of filter drop table.
#
# Syntax:
# filter_tbl_size SIZE
#
# Default:
# filter_tbl_size 16777216; # 16MB

# TAG: sticky
#
# Tempesta sticky cookie.
#
# Syntax:
# sticky [name=<COOKIE_NAME>] [enforce]
#
# Default:
# Tempesta sticky cookie is not used.
#
# COOKIE_NAME is the name of Tempesta sticky cookie is used in HTTP
# requests that pass through Tempesta. When not specified explicitly,
# a default name is used.
#
# enforce - enforce the use of Tempesta sticky cookie in all HTTP
# requests that come to Tempesta. If Tempesta sticky cookie is not
# found in an HTTP request, a client get an HTTP 302 response that
# redirects the client to the same URI, and prompts that Tempesta
# sticky cookie is set in the request.
#
# Examples:
# sticky; # Enable sticky cookie with default name.
# sticky enforce; # Enforce sticky cookie with default name.
# sticky name=__cookie__ enforce;

#
# Frang configuration.
#
# TAG: frang_limits
#
# The section containing static limits for the classifier.
#
# Syntax:
# frang_limits {
# request_rate NUM;
# request_burst NUM;
# connection_rate NUM;
# connection_burst NUM;
# concurrent_connections NUM;
# client_header_timeout NUM;
# client_body_timeout NUM;
# http_uri_len NUM;
# http_field_len NUM;
# http_body_len NUM;
# http_host_required true|false;
# http_methods [METHOD]...;
# http_ct_required true|false;
# http_ct_vals ["CONTENT_TYPE"]...;
# }
#
# - options with names *_rate define requests/connections rate per second.
# - *_burst are temporal burst for 1/FRANG_FREQ of second.
# - http_* are static limits for contents of a HTTP request.
#
# Example:
# frang_limits {
# request_rate 20;
# request_burst 15;
# connection_rate 8;
# connection_burst 6;
# concurrent_connections 8;
# client_header_timeout 20;
# client_body_timeout 10;
# http_uri_len 1024;
# http_field_len 256;
# http_ct_required false;
# http_methods get post head;
# http_ct_vals "text/plain" "text/html";
# http_header_chunk_cnt 10;
# http_body_chunk_cnt 0;
# }
#
# Default:
# All limits are disabled (the values are set to zero/false/empty).


0 comments on commit e646774

Please sign in to comment.