In an upstream configuration like this:
upstream name {
...
}
I'm wondering what characters can be used in the name. Does it have to be alphanumeric or are there other characters that are also allowed?
upstream defines a cluster that you can proxy requests to. It's commonly used for defining either a web server cluster for load balancing, or an app server cluster for routing / load balancing.
Upstream Domain Resolve¶ Its buffer has the latest IPs of the backend domain name and it integrates with the configured load balancing algorithm (least_conn, hash, etc) or the built in round robin if none is explicitly defined. At every interval (one second by default), it resolves the domain name.
fail_timeout = time sets. the time during which the specified number of unsuccessful attempts to communicate with the server should happen to consider the server unavailable; and the period of time the server will be considered unavailable.
The fail_timeout and max_fails parameter merely state that if there are a given number of failures during a given time, the server is considered unavailable.
ngx_upstream_jdomain - an upstream module that resolves an upstream domain name asynchronously. Its buffer has the latest IPs of the backend domain name and it integrates with the configured load balancing algorithm (least_conn, hash, etc) or the built in round robin if none is explicitly defined.
The transparent parameter (1.11.0) allows outgoing connections to a proxied server originate from a non-local IP address, for example, from a real IP address of a client: In order for this parameter to work, it is usually necessary to run nginx worker processes with the superuser privileges.
Writing to temporary files is controlled by the proxy_max_temp_file_size and proxy_temp_file_write_size directives. When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. nginx will not try to read the whole response from the proxied server.
By default, nginx does not pass the header fields “Date”, “Server”, “X-Pad”, and “X-Accel-...” from the response of a proxied server to a client. The proxy_hide_header directive sets additional fields that will not be passed.
Here's the code that reads a token from configuration file: https://github.com/nginx/nginx/blob/master/src/core/ngx_conf_file.c#L771
Seems that you can use any characters you like, except for spaces, tabs, and variable interpolations. (you can use spaces and tabs if you wrap the upstream name in quotes or escape the characters where necessary).
I've got this abomination to work, so it seems that nginx is fairly liberal in terms of what characters are acceptable:
upstream x_2.2-34%15=54^1@2!&3()4aoeu't {
server 127.0.0.1:8086;
}
server {
location / {
proxy_pass http://x_2.2-34%15=54^1@2!&3()4aoeu't;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With