Questions tagged [nginx-log]

21 questions
3
votes
0 answers

How to print request_body and response_body from NGINX

I want to print the request_body and response_body from NGINX. I try to implement a few of the solution that I have learned from here But it was not working in my case. Is there some additional changes that I need to configure in my NGINX.conf…
2
votes
0 answers

How to get proper information about user agent in nginx log?

I've used Nginx docs and set access log format. https://docs.nginx.com/nginx/admin-guide/monitoring/logging/ access_log /var/log/nginx/access.log; log_format compression '$remote_addr - $remote_user [$time_local] ' '"$request"…
Matija Lukic
  • 599
  • 8
  • 28
1
vote
0 answers

NGINX access logs from Single Page Application (SPA) and CMS

We have a frontend Angular app of Single Page Application and CMS design, where which is hosted in a docker container based on NGINX. The config is simply as below. The problem is that the access log only writes logs when the whole page is refreshed…
1
vote
2 answers

Nginx logs in both file as well as docker log collector

I am deploying a Nginx container and in the standard Dockerfile logs are being redirected to container logs with these commands RUN ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log If I remove above…
Aak
  • 269
  • 4
  • 16
1
vote
1 answer

Disable Nginx logging of 403 errors

Is it possible to stop Nginx logging 403 errors? I am using the directive: error_log /var/www/error.log; You can use log_not_found to stop the logging of 404s, but I can't see a way to stop the logging of 403s.
Kohjah Breese
  • 4,008
  • 6
  • 32
  • 48
1
vote
1 answer

Nginx shows 2 different statuses in the upstream response log

I am running an nginx-ingress controller in a kubernetes cluster and one of my log statements for the request looks like this: upstream_response_length: 0, 840 upstream_response_time: 60.000, 0.760 upstream_status: 504, 200 I cannot quite…
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
1
vote
1 answer

Location not working for files but only for path

I have a nginx.conf that looks like this: server { ... root /var/opt/data/web; ... location ~* \.(?:eot|woff|woff2|ttf|js)$ { expires 1M; } ... location /one { root /var/opt/data/alternatives; try_files $uri $uri/ =404; …
Marged
  • 10,577
  • 10
  • 57
  • 99
0
votes
0 answers

Why do nginx processes write logs without errors

Nginx has a main process and many work processes, they all write error log to the same file. I have tried multi-processes write to the same file, this will cause an error and some data will be overwritten. But I have read nginx codes and do find any…
Yongqi Z
  • 605
  • 8
  • 20
0
votes
0 answers

many 499 status codes in nginx log, how can I conduct a more detailed analysis

there is my nginx config log_format main '$time_iso8601 [$request] $body_bytes_sent $status $request_time $upstream_response_time $upstream_connect_time $upstream_header_time'; upstream helloworld { server localhost:8080; } server { listen…
0
votes
1 answer

aws nginx ec2 instance save access log to s3bucket

I have an infra in aws that is composed of the following services: load balancer launch configuration autoscaling ec2 (nginx reverse proxy) Everything works just smoothly without any particular issue but there is a little problem that is bothering…
Nayden Van
  • 1,133
  • 1
  • 23
  • 70
0
votes
0 answers

panic: Put http://localhost:8080/v1/agent/service/register?dc=dc1: dial tcp 127.0.0.1:8080: connect: connection refused

I am trying to running docker for https://github.com/martin-helmich/prometheus-nginxlog-exporter#docker nginxlog exporter and I am getting`panic: Put http://localhost:8080/v1/agent/service/register?dc=dc1: dial tcp 127.0.0.1:8080: connect:…
0
votes
1 answer

Send nginx logs to google cloud logging from OVH VPS

I have an OVH VPS with nginx server setup on it. I'm looking for a way to send nginx access and error logs to Google Cloud Logging service, but all info I could find was about sending logs from Google Cloud VMs. Is it even possible at this moment?…
0
votes
1 answer

Nginx: Conditional Log based on log message

I'm trying to filter my log, based on a string contained in log message. I found some hints to use conditional logging (https://www.nginx.com/blog/sampling-requests-with-nginx-conditional-logging/), but i couldn't find any hints for my use case. Is…
JD2k
  • 48
  • 1
  • 7
0
votes
1 answer

How to convert Nginx error.log to json format

Is there a way to convert the error.log in Nginx to json? I need to ship the logs to an external log viewer, to do that I need to convert the error.log to json.
Sine C
  • 41
  • 4
0
votes
1 answer

How to block GET on NGINX for a particular directory served? (either by referer or user agent)

A server I run is currently getting spammed... hard... The IPs are changing every few requests. The server is now returning 403s for anything POSTed at /contact/, but the spammy script/bot is still hitting the server hard–taking up resources and…
jon.s
  • 165
  • 1
  • 2
  • 16
1
2