Size: a a a

2021 April 07

k

kiosaku in nginx_ru
источник

KH

Kam Hosuen in nginx_ru
alrighty, let me read on that, thanks
источник

DM

Damir Manyapov in nginx_ru
Ребята подскажите я могу параметр proxy_read_timeout на весь сервер поставить? то есть в глобальный конфиг?
источник

А

Анатолий in nginx_ru
подскажите, установлен модуль rtmp и транслирует картинку нормально в rtmp://ip:port
можно ли nginx настроить чтобы ещё в rtsp транслировал?
источник

HF

Hugo Florentino in nginx_ru
Hi, may I clear a doubt here regarding an odd behavior in Nginx?
(forgive me for writing in english, I can't speak Russian)
источник

AN

Anton Noginov in nginx_ru
Do you run it in docker?
Then it's a docker's behaviour, not nginx's one :)
источник

HF

Hugo Florentino in nginx_ru
Nope, it's running on a VMWare instance with Ubuntu 20.04, x86_64
источник

AN

Anton Noginov in nginx_ru
Share some details then
источник

HF

Hugo Florentino in nginx_ru
According to the official documentation, access_log can be used in the contexts http, server, location, if in location, and limit_except.

I have 2 virtualhosts. One is a catch-all virtualhost with por 80 declared as default_server and the other is an actual website. The idea is that when someone tries to access by IP address, the request will be processed by the default virtualhost.

However, what is happening is that if I declare access_log within a location block in my default virtualhost, not only the request isn't logged, but passes to the actual website virtualhost.

If the access_log is declared at the server block instead, everything works as expected.

I have no Idea why is this happening. This is with Nginx 1.18, on Ubuntu 20.04 x86_64
источник

AN

Anton Noginov in nginx_ru
Please share the whole configuration.
I guess, there's just a typo in config.
источник

AN

Anton Noginov in nginx_ru
via pastebin
источник

HF

Hugo Florentino in nginx_ru
it's rather short:
источник

HF

Hugo Florentino in nginx_ru
It works as expected this way:

server {
 listen 80 default_server;

 access_log /var/log/nginx/catchall.log custom;

 location / {
   return 404;
 }
}


But not this way:

server {
 listen 80 default_server;

 location / {
   access_log /var/log/nginx/catchall.log custom;
   return 404;
 }
}
источник

AN

Anton Noginov in nginx_ru
server {
 listen 44480 default_server;

 location / {
   access_log /tmp/nginx_test/default-access.log main ;
   return 404;
 }
}

server {
 listen 44480 ;
 server_name lala ;

 access_log /tmp/nginx_test/vhost-access.log main ;

 location / {
   return 200 "OK";
 }
}


Works as expected.
источник

HF

Hugo Florentino in nginx_ru
Not in my case. Could it be a result of my custom log format?
источник

AN

Anton Noginov in nginx_ru
Yep. That's why I've asked for a configuration.
источник

HF

Hugo Florentino in nginx_ru
I just removed the custom format and same thing happens.
источник

AN

Anton Noginov in nginx_ru
I'm done with guessing here. It's clear that the request is matched with other vhost somehow.
источник

HF

Hugo Florentino in nginx_ru
That's what puzzles me. It should never match that because it's a named virtualhost.
источник

HF

Hugo Florentino in nginx_ru
I just found what it is. I had an include in the default virtualhost with a few custom error_page instructions.
источник