P
P
pcdesign2017-09-07 12:41:03
Nginx
pcdesign, 2017-09-07 12:41:03

Is it possible to disable image logging globally?

server {
    listen  80;
  server_name  example.ru; 
  location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    access_log        off;
  }

For each server, you have to prescribe disabling logging of statics.
Is there any way to do this globally?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Mukovoz, 2017-09-07
@pcdesign

You can not prescribe in each. Create a file in it and write settings common to all virtual hosts. And then you register in each virtual host.
Profit)) And you can generally make just one virtual host that will be universal for all sites.

server {
    server_name   ~^(www\.)?(?<domain>.+)$;

    location / {
        root   /sites/$domain;
    }

here $host is taken as a variable and a folder is selected according to this name. It is also possible to shove everything else through variables. If you need help, please contact)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question