OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: W0nderW0lf on February 18, 2022, 05:23:52 pm

Title: NGINX no live upstreams while connecting
Post by: W0nderW0lf on February 18, 2022, 05:23:52 pm
Hi everyone,

I try to clean up my log errors and on every config I have this one error:
Code: [Select]
388 no live upstreams while connecting to upstream, client: x.x.x.x, server: some.domain.com, request: "GET /rest/getCoverArt.view?u=simsa&t=b919d772645533e1647af3d8106f9622&s=6IWsdzb&v=1.13.0&c=substreamer&f=json&size=500&id=cf464d1226945f4a913f06237a281bd7 HTTP/1.1", upstream: "http://upstream67c0fb4aebe44d9884a90b4cf7d49264/rest/getCoverArt.view?u=simsa&t=b919d772645533e1647af3d8106f9622&s=6IWsdzb&v=1.13.0&c=substreamer&f=json&size=500&id=cf464d1226945f4a913f06237a281bd7", host: "some.domain.com"
I red that it has something to do with the header config. Unfortunately I cannot find a guide or documentation on how to fix this. I found this page (https://debugah.com/there-are-a-lot-of-no-live-upstreams-while-connecting-to-upstream-about-nginx-logs-8008/) describing that I would need to set the proxy_set_header: Connection=" "
In the GUI I saw "Security Headers", but is this the same? And what area should I focus on if so?

Thx 4 help forward
Title: Re: NGINX no live upstreams while connecting
Post by: Fright on February 19, 2022, 11:54:02 am
Hi
i think you can try to do this via locations hooks:
if you look at the /usr/local/etc/nginx.conf, at the end of each location block you can see directives like "    include 279b8caa-f779-4422-8d2e-18ed845311ec_post/*.conf;". this way you can create folders pointed to by the corresponding directives and put files with additional "proxy_set_header" directives in them
Title: Re: NGINX no live upstreams while connecting
Post by: W0nderW0lf on February 19, 2022, 03:58:09 pm
Hi,

I dont know if that would work. I cant find the right location. It's hard to estimate which one would be the right "include 105b."
On the other side, I dont know how the config has to look and if this getting backuped?
Title: Re: NGINX no live upstreams while connecting
Post by: Fright on February 19, 2022, 05:09:35 pm
- open  /usr/local/etc/nginx.conf and find your server config block (by server name, port or some)
- after "    location /opnsense-auth-request" block inside this server block there will be directive like
  "include 99c0ce9c-dab2-4274-881f-868867990eb2_pre/*.conf;"
- create folder 99c0ce9c-dab2-4274-881f-868867990eb2_pre in /usr/local/etc/
- put custom.conf file (with proxy_set_header: Connection=" "; directive) in 99c0ce9c-dab2-4274-881f-868867990eb2_pre dir

Quote
config has to look and if this getting backuped?
main nginx.conf or your "custom header" config?
Title: Re: NGINX no live upstreams while connecting
Post by: W0nderW0lf on February 20, 2022, 09:59:17 pm
Thx for your guide.
I managed to create a config.
Havent seen the error yet, so maybe it worked.

To my backup question, I know the main nginx.conf is being backup'd but I am unsure if this is the case for the custom directory+custom.conf.
Title: Re: NGINX no live upstreams while connecting
Post by: Fright on February 21, 2022, 07:26:02 am
Quote
but I am unsure if this is the case for the custom directory+custom.conf.
definitely not. needs to be maintained independently
Title: Re: NGINX no live upstreams while connecting
Post by: W0nderW0lf on February 21, 2022, 07:17:42 pm
Seems like that didn't work.
Nginx didn't start after reboot, so I checked the logs.
Code: [Select]
unknown directive "proxy_set_header:" in /usr/local/etc/nginx/775f77a7-073f-4e92-845e-02baaf789131_pre/custom.conf:1I have a single line.
Code: [Select]
proxy_set_header: Connection="";
Do I have to configure an entire block with location and stuff?
Title: Re: NGINX no live upstreams while connecting
Post by: Fright on February 21, 2022, 07:57:45 pm
not sure if the colon is needed here  ;)
try something like
proxy_set_header Connection "";
Title: Re: NGINX no live upstreams while connecting
Post by: W0nderW0lf on February 22, 2022, 12:43:09 pm
Hmm.. Syntax seems fine now. No more error, but...
Still getting these:
Code: [Select]
*9 no live upstreams while connecting to upstream, client: x.x.x.x, server: some.domain.com, request: "GET /rest/getTopSongs.view?u=odin&t=616d2cd4e844b4fa80a6a6b2f983d223&s=sS6rg6u&v=1.13.0&c=substreamer&f=json&artist=The%20Dandy%20Warhols&count=10 HTTP/1.1", upstream: "http://upstream67c0fb4aebe44d9884a90b4cf7d49264/rest/getTopSongs.view?u=odin&t=616d2cd4e844b4fa80a6a6b2f983d223&s=sS6rg6u&v=1.13.0&c=substreamer&f=json&artist=The%20Dandy%20Warhols&count=10", host: "some.domain.com"What I find strange is, that I cant use the GUI to stop or restart the service. I just see that it's loading, but still running. Stopping has no function as it seems.
 :-\
Title: Re: NGINX no live upstreams while connecting
Post by: Fright on February 22, 2022, 01:10:16 pm
Quote
Syntax seems fine now. No more error, but...
in this case, probably setting the header value is not a solution
maybe Nginx really can't connect to upstream, upstream is busy or something else