[GH-ISSUE #746] Change access log filenames to domain name (or add option) #632

Open
opened 2026-02-26 06:33:45 +03:00 by kerem · 10 comments
Owner

Originally created by @joewesch on GitHub (Nov 29, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/746

Is your feature request related to a problem? Please describe.
It's very frustrating to try and determine which log file is for which site since they are all named after the arbitrary ID that they are assigned when created.

Describe the solution you'd like
It would be nice to instead have them named after the first domain in the domain_names list.

~BEFORE~
# ls
proxy_host-1.log  proxy_host-10.log  proxy_host-11.log	proxy_host-2.log  proxy_host-3.log  proxy_host-4.log  proxy_host-5.log	proxy_host-6.log  proxy_host-7.log  proxy_host-8.log  proxy_host-9.log

~AFTER~
# ls
domain.example.com.log fqdn.something.log ...

Using the template on how the domain names are set for server_name, I assume this can be accomplished by simply changing the access log line to something like this (proxy host as the example):

access_log /data/logs/{{ domain_names[0] }}.log proxy;
OR
access_log /data/logs/{{ domain_names | first }}.log proxy;

Describe alternatives you've considered
I tried to just add a custom access_log line to the advanced configuration, but instead of overwriting the previous setting it sends logs to both files.

Additional context
N/A

Originally created by @joewesch on GitHub (Nov 29, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/746 **Is your feature request related to a problem? Please describe.** It's very frustrating to try and determine which log file is for which site since they are all named after the arbitrary ID that they are assigned when created. **Describe the solution you'd like** It would be nice to instead have them named after the first domain in the `domain_names` list. ``` ~BEFORE~ # ls proxy_host-1.log proxy_host-10.log proxy_host-11.log proxy_host-2.log proxy_host-3.log proxy_host-4.log proxy_host-5.log proxy_host-6.log proxy_host-7.log proxy_host-8.log proxy_host-9.log ~AFTER~ # ls domain.example.com.log fqdn.something.log ... ``` Using the [template on how the domain names](https://github.com/jc21/nginx-proxy-manager/blob/030e5535495dc7a0050fc34f2b9aef76ba45c3d2/backend/templates/_listen.conf#L15) are set for `server_name`, I assume this can be accomplished by simply changing the access log line to something like this (proxy host as the example): ``` access_log /data/logs/{{ domain_names[0] }}.log proxy; OR access_log /data/logs/{{ domain_names | first }}.log proxy; ``` **Describe alternatives you've considered** I tried to just add a custom `access_log` line to the advanced configuration, but instead of overwriting the previous setting it sends logs to both files. **Additional context** N/A
Author
Owner

@joewesch commented on GitHub (Nov 29, 2020):

I have verified that the solution that I presented will indeed work by mounting my own proxy_host.conf file with the change into my container. The only thing left would be to decide if this will be the default (and just need to update the templates) or if this should be an option presented to the user. If the default can be changed I can provide a PR to update the templates.

<!-- gh-comment-id:735317146 --> @joewesch commented on GitHub (Nov 29, 2020): I have verified that the solution that I presented will indeed work by mounting my own `proxy_host.conf` file with the change into my container. The only thing left would be to decide if this will be the default (and just need to update the templates) or if this should be an option presented to the user. If the default can be changed I can provide a PR to update the templates.
Author
Owner

@chaptergy commented on GitHub (May 12, 2021):

Sure, if you still have not encountered any issues with this change, go ahead and open a PR. I'm sure a lot of people would be very happy about that.

<!-- gh-comment-id:840104598 --> @chaptergy commented on GitHub (May 12, 2021): Sure, if you still have not encountered any issues with this change, go ahead and open a PR. I'm sure a lot of people would be very happy about that.
Author
Owner

@bohemtucsok commented on GitHub (Feb 10, 2023):

Hello

maybe there is already a solution for this?

<!-- gh-comment-id:1425908997 --> @bohemtucsok commented on GitHub (Feb 10, 2023): Hello maybe there is already a solution for this?
Author
Owner

@joewesch commented on GitHub (Feb 11, 2023):

Hello,

It doesn't look like this has been implemented just yet. I'll throw in a PR for the change. It has been working for me so far.

<!-- gh-comment-id:1426533015 --> @joewesch commented on GitHub (Feb 11, 2023): Hello, It doesn't look like this has been implemented just yet. I'll throw in a PR for the change. It has been working for me so far.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 23, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2016297362 --> @github-actions[bot] commented on GitHub (Mar 23, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@joewesch commented on GitHub (Mar 23, 2024):

I'm still waiting for my PR to be merged.

<!-- gh-comment-id:2016300157 --> @joewesch commented on GitHub (Mar 23, 2024): I'm still waiting for my PR to be merged.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 17, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2547348109 --> @github-actions[bot] commented on GitHub (Dec 17, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@joewesch commented on GitHub (Dec 17, 2024):

👍🏻

<!-- gh-comment-id:2547381189 --> @joewesch commented on GitHub (Dec 17, 2024): 👍🏻
Author
Owner

@github-actions[bot] commented on GitHub (Nov 11, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:3514689663 --> @github-actions[bot] commented on GitHub (Nov 11, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@kramttocs commented on GitHub (Jan 15, 2026):

It would be great to get this added. Would beat having to keep a notepad file with what the different ones map to

<!-- gh-comment-id:3756948000 --> @kramttocs commented on GitHub (Jan 15, 2026): It would be great to get this added. Would beat having to keep a notepad file with what the different ones map to
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#632
No description provided.