Current setup as follows:
stream {
server {
listen 9987 udp;
server_name subdomain.EXAMPLE.com; # this line is resulting in an error
proxy_pass localhost:9987;
proxy_timeout 1s;
proxy_responses 1;
error_log logs/dns.log;
}
}
server_name subdomain.EXAMPLE.com;
Is this possible?
$nginx -t
$nginx: [emerg] "server_name" directive is not allowed here in /etc/nginx/nginx.conf:15
Works just fine without server_name, but I'd like to use a sub-domain if possible. (I am using a build with --with-stream, thats not my issue.)
server { listen 80; server_name example.org www.example.org ""; ... } If no server_name is defined in a server block then nginx uses the empty name as the server name. nginx versions up to 0.8. 48 used the machine's hostname as the server name in this case. If a server name is defined as “ $hostname ” (0.9.
Load balancing refers to efficiently distributing network traffic across multiple backend servers. In NGINX Plus Release 5 and later, NGINX Plus can proxy and load balance Transmission Control Protocol) (TCP) traffic. TCP is the protocol for many popular applications and services, such as LDAP, MySQL, and RTMP.
Yes, it does and totally depends on different directives specified within the different context supported by Nginx.
The proxy_pass setting makes the Nginx reverse proxy setup work. The proxy_pass is configured in the location section of any virtual host configuration file. To set up an Nginx proxy_pass globally, edit the default file in Nginx's sites-available folder.
TCP has no concept of server names, so this is not possible. It only works in HTTP because the client sends the hostname it is trying to access as part of the request, allowing nginx to match it to a specific server block.
Source: https://forum.nginx.org/read.php?2,263208,263217#msg-263217
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