D
D
di2021-06-22 12:19:26
Nginx
di, 2021-06-22 12:19:26

What is the easiest way to make a request logger on nginx?

In general, I want to test what the apishka sends to the webhook. it is required that the webhook use https

So far I came up with the following:
1. register a domain and bind it to VPS
2. deploy nginx and certbot on vps. I will create a certificate accordingly and set up https

The question is exactly how to log the request that will come to nginx. There must be some simple solution. or be sure to write some kind of test application, for example, in php.

Ideally, I just want to see the request log in detail with the method, status, and data. Is it possible? Or all this is already out of the box, but where to look?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sand, 2021-06-22
@Delgus

The access_log and error_log directives, for example:

server {
        server_name _;
        access_log /var/log/nginx/my.site.access.log;
        error_log /var/log/nginx/my.site.error.log notice;
        ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question