You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
sorry for this, I am sure well treated, question, but after 3 evenings with countess blogs, videos and tutorials/ posts I did not get any kind of progress.
I use nginx proxy manager in docker compose (latest image from this side). I would like to get the logs out of the container to use them for a fail2ban addition (different container).
I know, that under /path/to/nginx-volume/logs there are files like fallback_access.log and fallback_error.log as well as proxy_host1_acces.log and the according error.log file. These however show some entries but (as far as I know, they should be updated, whenever nginx discovers a access try or so) they are not up to date and refreshing does not show any new entries, even if I provoke some myself.
I changed the log_format section in the nginx.conf file in the container with no change in the logging. Also I discovered that in the container under /etc/nginx, there is the nginx.conf file and the nginx.conf.default file (in which I found the log_frame section commented out. The nginx.conf file looks not at all like in the tutorials, however the .conf.default does.
Here is the nginx.conf file:
# run nginx in foreground
daemon off;
pid /run/nginx/nginx.pid;
user npm;
# Set number of worker processes automatically based on number of CPU cores.
worker_processes auto;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;
error_log /data/logs/fallback_error.log warn;
# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;
# Custom
include /data/nginx/custom/root_top[.]conf;
events {
include /data/nginx/custom/events[.]conf;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
server_tokens off;
tcp_nopush on;
tcp_nodelay on;
client_body_temp_path /tmp/nginx/body 1 2;
keepalive_timeout 90s;
proxy_connect_timeout 90s;
proxy_send_timeout 90s;
proxy_read_timeout 90s;
ssl_prefer_server_ciphers on;
gzip on;
proxy_ignore_client_abort off;
client_max_body_size 2000m;
server_names_hash_bucket_size 1024;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
proxy_cache off;
proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m;
proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;
# Log format and fallback log file
include /etc/nginx/conf.d/include/log.conf;
# Dynamically generated resolvers file
include /etc/nginx/conf.d/include/resolvers.conf;
# Default upstream scheme
map $host $forward_scheme {
default http;
}
# Real IP Determination
# Local subnets:
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 172.16.0.0/12; # Includes Docker subnet
set_real_ip_from 192.168.0.0/16;
# NPM generated CDN ip ranges:
include conf.d/include/ip_ranges.conf;
# always put the following 2 lines after ip subnets:
real_ip_header X-Real-IP;
real_ip_recursive on;
# Custom
include /data/nginx/custom/http_top[.]conf;
# Files generated by NPM
include /etc/nginx/conf.d/*.conf;
include /data/nginx/default_host/*.conf;
include /data/nginx/proxy_host/*.conf;
include /data/nginx/redirection_host/*.conf;
include /data/nginx/dead_host/*.conf;
include /data/nginx/temp/*.conf;
# Custom
include /data/nginx/custom/http[.]conf;
}
stream {
# Files generated by NPM
include /data/nginx/stream/*.conf;
# Custom
include /data/nginx/custom/stream[.]conf;
}
# Custom
include /data/nginx/custom/root[.]conf;
and here you can see the nginx.conf.default File (Beginning with the log_format section and access_log section commented in by myself):
I could not find any place in the nginx.conf file which seemed to inlcude the default one, so I am rather bamboozled about the existance of this file. Could I just change the two (like swapping)
Also another question: How do I make the changes in the nginx.conf Files (which I made in the container) persistent?
Maybe with an additional volume line in the docker compose:
/path/to/volume/nginx.conf:/etx/nginx/nginx.conf
Thank you so much in advance for your help and sorry for this long text.
I hope I made everything clear enough for you to work with. If not, please let me know :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
sorry for this, I am sure well treated, question, but after 3 evenings with countess blogs, videos and tutorials/ posts I did not get any kind of progress.
I use nginx proxy manager in docker compose (latest image from this side). I would like to get the logs out of the container to use them for a fail2ban addition (different container).
I know, that under /path/to/nginx-volume/logs there are files like fallback_access.log and fallback_error.log as well as proxy_host1_acces.log and the according error.log file. These however show some entries but (as far as I know, they should be updated, whenever nginx discovers a access try or so) they are not up to date and refreshing does not show any new entries, even if I provoke some myself.
I changed the log_format section in the nginx.conf file in the container with no change in the logging. Also I discovered that in the container under /etc/nginx, there is the nginx.conf file and the nginx.conf.default file (in which I found the log_frame section commented out. The nginx.conf file looks not at all like in the tutorials, however the .conf.default does.
Here is the nginx.conf file:
and here you can see the nginx.conf.default File (Beginning with the log_format section and access_log section commented in by myself):
I could not find any place in the nginx.conf file which seemed to inlcude the default one, so I am rather bamboozled about the existance of this file. Could I just change the two (like swapping)
Also another question:
How do I make the changes in the nginx.conf Files (which I made in the container) persistent?
Maybe with an additional volume line in the docker compose:
Thank you so much in advance for your help and sorry for this long text.
I hope I made everything clear enough for you to work with. If not, please let me know :)
Beta Was this translation helpful? Give feedback.
All reactions