Questions tagged [nginx-upstreams]
50 questions
7
votes
2 answers
"host not found in upstream ..." when using 'kubectl apply -f' but works in 'docker-compose up'
I have four images in docker which are two services, a frontend and a reverseproxy.
When I was using docker-compose up, it works and the services were running.
But when I want to use kubectl apply -f to run in pod. There are [emerg] 1#1: host not…

bmjLearnToCODE
- 83
- 1
- 5
6
votes
0 answers
NGINX proxy_pass returns content-type HTML instead of content-type JAVASCRIPT
I have the following NGINX config
events {}
http {
access_log /dev/stdout;
error_log /dev/stderr;
resolver 1.1.1.1 1.0.0.1 valid=5s ipv6=off; # CloudFlare DNS resolver
upstream myupstream {
server …

Rakib
- 12,376
- 16
- 77
- 113
3
votes
1 answer
Nginx Load Balancing HTTPs cluster
I watn to use Nginx as load balancer for Consul cluster. The Consul cluster is reachable only with TLS.
Here I've tried to reverse proxy a single Consul server to check if the TLS certificates are working
server {
listen 80;
listen [::]:80;
…

Kingindanord
- 1,754
- 2
- 19
- 48
2
votes
0 answers
Nginx : Use a variable for proxy_read_timeout
I would like to have a dynamic proxy_read_timeout.
But when I use a variable like this :
proxy_read_timeout $upstream_read_timeout;
I get this error :
"proxy_read_timeout" directive invalid value
I guess it means that proxy_read_timeout value…

Olivier Masseau
- 778
- 7
- 23
2
votes
1 answer
Nginx proxy_pass with variables
I've got 2 upstreams and described the logic of cookie check in nginx config:
upstream back {
server backend-release.mynamespace.svc.cluster.local;
}
upstream back-preprod {
server backend-preprod.mynamespace.svc.cluster.local;
}
map…

Andy
- 31
- 2
2
votes
0 answers
Rails + Nginx - why i should use fail_timeout=0 for multiple nodes?
In nginx example config file here https://github.com/defunkt/unicorn/blob/master/examples/nginx.conf
you may see that:
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the…

Andrey Artemyev
- 452
- 4
- 11
2
votes
1 answer
Nginx as loadbalancer for wordpress, error serving static files
I'm setting up a simple environment on docker with the following stack:
nginx as load balance
wordpress instance
mysql
My simple docker compose file is the following:
nginx:
build: ../nginx
links:
- wordpress:wordpress
ports:
-…

ddelizia
- 1,571
- 5
- 30
- 54
1
vote
0 answers
Setup nginx not to crash if host in upstream is not found with upstream group
I have read question 32845674 (and many others) and the answers to it, but I don't understand how to apply the solution shown to my case:
In my nginx configuration, upstreams are used specifically for grouping servers (which are multiple docker…

Артём Гусинцев
- 11
- 1
1
vote
2 answers
how to split traffic from same url path to 2 different upstreams?
i have these upstreams declared:
upstream upstream_1 {
server some_container_1:8000;
}
upstream upstream_2 {
server some_container_2:8001;
}
and this server:
server {
listen 7000;
server_name localhost;
location /path {
…

rado
- 5,720
- 5
- 29
- 51
1
vote
1 answer
Can't figure out nginx config: *2 no resolver defined to resolve backend
I can't figure out the NGINX config to launch the site.
I can’t figure it out myself, all the same, there is not enough theoretical basis. Maybe you can advise.
env BACKEND_API;
error_log /var/log/nginx/error.log warn;
pid …

freeholod
- 11
- 2
1
vote
1 answer
Setup NGINX to serve several sites on the same host
Trying to figure out how I could setup NGINX to serve several sites on the same host, with subfolder unified config.
trying to have mydomain.com/blue and mydomain.com/red serving 2 different NodeJS websites.
So far I did this :
2 configs, which are…

Simon Mo
- 503
- 2
- 4
- 14
1
vote
2 answers
NGINX : Using Upstream server name
I am running nginx/1.19.6 on Ubuntu.
I am struggling to get the upstream module to work without returning a 404.
My *.conf files are located in /etc/nginx/conf.d/
FILE factory_upstream.conf:
upstream factoryserver {
server …

Joe B
- 692
- 8
- 18
1
vote
0 answers
How do I use environment variables in nginx to choose conditional upstream config
I have an environment variable that I would like to set while starting an nginx service.
Let's say the environment variable is NGINX_SERVICE which can have value DEV or QA. And I want to conditionally set upstream config.
ie, Logically something…

Sreeraj Karichery
- 188
- 3
- 14
1
vote
1 answer
Custom response from Tarantool + Nginx
Have instance: Nginx in DMZ with TNT_nginx_upstream_module + Tarantool Cartridge as API server.
When i have response with good result - it's 200 OK + JSON with data
How to set other response?
400 Bad Request
403 Forbidden
404 Not found
410…

Sergey Kochugov
- 27
- 4
1
vote
1 answer
With NGINX upstreams, is it possible to proxy pass to both HTTP and HTTPS backends in the same upstream?
Suppose I want to proxy some portion of my traffic to a remote backend instead of the local listener on the server. For example:
upstream backends {
server 127.0.0.1:8080 weight=20; # local process (HTTP)
server…

Alex Urcioli
- 2,883
- 3
- 11
- 17