Custom Query (2297 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (49 - 51 of 2297)

Ticket Resolution Summary Owner Reporter
#1889 invalid access_log off; returns 404 with nginx proxy rameshsahoo11@…
Description

Summary:

With nginx reverse proxy mode, I am trying to turn off access_log for a specific location. Doing so Nginx returns 404 for that location. Refer to the following example.

Front-end Nginx configuration:

server {

listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/site1_access main; error_log /var/log/nginx/site1_error debug;

location ~* /icons/* {

access_log off;

}

location / {

proxy_pass http://192.168.50.2; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name;

}

}

Requirement:

=> My requirement is to turn off nginx logs on the backend server in order to save IO and configure the front-end to provide proxy pass and all website logs.

Refer to the following access and error logs.

============ Nginx logs ============

Main Page:http://172.17.0.2 ==> /var/log/nginx/site1_access <== 172.17.0.1 - - [12/Nov/2019:09:52:26 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" "-"

==> /var/log/nginx/site1_error <== 2019/11/12 09:54:10 [error] 188#188: *3 open() "/var/lib/nginx/html/icons/nginx-logo.png" failed (2: No such file or directory), client: 172.17.0.1, server: , request: "GET /icons/nginx-logo.png HTTP/1.1", host: "172.17.0.2"

The above logs indicate that nginx is trying serve the page from the front-end server instead of forwarding the request to backend.

#713 invalid access_log path with variable computes path incorrectly https://stackoverflow.com/users/573152/bernard-rosset
Description

In /etc/nginx/conf.d/example.com.conf:

map $http_user_agent $access_log {
    ~*bot       off;
    default     /var/log/nginx/example.com/access.log;
}
server {
    access_log  $access_log main;
}

File is included from /etc/nginx/nginx.conf, after log_format main is defined

error.log contains:

[crit] 9091#0: *252296 open() "/etc/nginx//var/log/nginx/example.com/access.log" failed (2: No such file or directory) while logging request
#67 invalid access_log with variables in filename does not work somebody Andrey Lyarskiy
Description

Original config: log_format combined_time '$remote_addr - $remote_user - $proxy_host $upstream_addr [$time_local] '

'"$request" $status $body_bytes_sent $request_time';

server { ... access_log /var/log/nginx/$host.access.log combined_time; ... }

Nginx does not creating new log files, and does not write logs access logs at all.

Changing to: access_log /var/log/nginx/testing.access.log combined_time;

Log file successfully created.

Changing to: set $site test1; access_log /var/log/nginx/$site.access.log combined_time;

And again no files created and no access logs at all.

# getenforce Permissive

Nginx installed from RPM (http://nginx.org/packages/rhel/6/). OS - Scientific Linux 6.1 x86_64

Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.