Size: a a a

2021 April 07

LS

Lilo Stich in nginx_ru
With the $proxy_protocol_addr and $proxy_protocol_port variables which capture the original client IP address and port. The $remote_addr and $remote_port variables capture the IP address and port of the load balancer.
🤔
источник

AN

Anton Noginov in nginx_ru
А откуда взялась уверенность, что на первом nginx в стрим коннект приходит от клиента, а не от ингреса?
источник

HF

Hugo Florentino in nginx_ru
Suppose you have a configuration like the one below.
What log should receive the entry if your browser tries to access http://1.2.3.4/favicon.ico ?

server {
 listen 80 default_server;

 access_log /var/log/nginx/catchall_general.log;

 error_page 404 /404.html;
 location = /404.html {
   internal;
   root /var/www/error;
   access_log /var/log/nginx/catchall_404.log;
 }

 location = /favicon.ico {
   access_log off;
   log_not_found off;
 }

 location = /robots.txt {
   access_log off;
   log_not_found off;
 }

 location / {
   access_log /var/log/nginx/catchall_location.log;
   return 404;
 }
}

server {
 listen 80;
 server_name $hostname;

 access_log /var/log/nginx/virtualhost.log;

 root /var/www/html;
 index index.html index.htm;

 location / {
   try_files $uri $uri/ =404;
 }
}
источник

AN

Anton Noginov in nginx_ru
I don't care indeed :)
I'll never have something like this :)

But - expect catchall_404.log
источник

HF

Hugo Florentino in nginx_ru
how can favicon.ico be excluded then ?
источник

AN

Anton Noginov in nginx_ru
What do you mean - "how"?
You got a location with literally no other options then serve a file from a doc_root. You don't have that file there - therefor 404 arise, and according to a server_level error_page - end up at /404.html
источник

HF

Hugo Florentino in nginx_ru
yes, but you are explicitly denying entries in the log for favicon.ico
источник

HF

Hugo Florentino in nginx_ru
and Nginx simply ignores it
источник

AN

Anton Noginov in nginx_ru
Sorry, I'm done here. The cause was explained, the solutions proposed.
источник

E

Ernesto 🇨🇺 in nginx_ru
If you favicon don't exist this trigger the 404 location
источник

HF

Hugo Florentino in nginx_ru
only if you use error_page, with the hardcoded 404 the access_log in the root location works just fine
источник

HF

Hugo Florentino in nginx_ru
The VPS has limited storage, I don't want logging unnecesary stuff. How can I exclude those?
источник

E

Ernesto 🇨🇺 in nginx_ru
Check the uri inside the location 404.html and disable the logs if match
источник

HF

Hugo Florentino in nginx_ru
in other words, move the favicon and robots locations to the 404 redirect?
источник

HF

Hugo Florentino in nginx_ru
would that work ?
источник

HF

Hugo Florentino in nginx_ru
if the $uri is already /404.html because of the redirect, those might never match
источник
2021 April 08

HF

Hugo Florentino in nginx_ru
Never mind, I solved my need with a map
источник

АК

Алексей Крячко... in nginx_ru
Приветствую, Всех!
источник

ЕК

Егор Карась... in nginx_ru
Херцлищь Вилькоммен
источник

АК

Алексей Крячко... in nginx_ru
Зергуд)
источник