mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-25 16:55:56 +03:00
[GH-ISSUE #236] Support for cache configuration #1469
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#1469
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sanvu88 on GitHub (Dec 13, 2023).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/236
Caching both static and dynamic content of Nginx helps improve distribution speed for clients and reduces the load on the server.
To configure Nginx cache, I can provide a config template. However, I am encountering a small issue with configuring the cache storage directory.
Currently, I have to manually create the directory
/home/nginx/cache. However, it would be wonderful if the Nginx UI had a section for cache configuration and would automatically create the cache directory as entered.@0xJacky commented on GitHub (Dec 14, 2023):
What about adding a volume section in config template? Then you can define a volume in the template, and user can set the path in the UI and it will be created if the directory is not exist.
@sanvu88 commented on GitHub (Dec 15, 2023):
In my understanding, by default, Nginx will create a directory if it doesn't exist. However, it will only create the last directory in the path. For example, if my cache path is
/home/nginx/cacheand the cache directory does not exist, Nginx will create it. However, if both the nginx and cache directories do not exist, Nginx will return an error:
[emerg] mkdir() No such file or directory) nginx@0xJacky commented on GitHub (Dec 15, 2023):
Yes I understand, I want to use os.MkdirAll function, which can create a directory named path, along with any necessary parents.