-
Notifications
You must be signed in to change notification settings - Fork 1
nginx-proxy: use yaml config instead of hardcoded rules #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the nginx-proxy caching system to use YAML-based configuration instead of hardcoded rules. The change enables dynamic cache rule management through external configuration files while maintaining backward compatibility.
- Introduces YAML-based cache configuration system with
cache_rules.yaml
- Restructures Lua modules into organized subdirectories (
auth/
,cache/
,utils/
) - Adds comprehensive test suite with mock utilities for cache and nginx functionality
Reviewed Changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
nginx-proxy/nginx.conf | Adds CACHE_RULES_FILE environment variable and updates module paths |
nginx-proxy/cache_rules.yaml | New YAML configuration defining cache rules and TTL defaults |
nginx-proxy/lua/cache/*.lua | New cache modules implementing YAML-based caching logic |
nginx-proxy/lua_tests/* | Comprehensive test suite with mocking utilities |
docker-compose*.yml | Updates volume mounts and config file paths |
Dockerfiles | Installs YAML dependencies and updates file paths |
Comments suppressed due to low confidence (1)
nginx-proxy/lua_tests/test_utils/nginx_mocks.lua:19
- [nitpick] The mock MD5 function returns a predictable hash based on string length, which may not adequately test hash collision scenarios. Consider using a more realistic mock that generates unique hashes.
return "mock_hash_" .. string.len(str)
* extract filter providers function * use standard way to remove hop‑by‑hop headers * keep decoded body * fix providers reload scheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions, but LGTM!
53b4fb6
to
41e16d7
Compare
Key Changes
Yaml rules configuration instead of hardcoded lua dictionaries
Configuration Management
nginx-proxy/cache_rules.yaml
- cache rules configurationchain:network
→chain
→default
Code Structure Refactoring
New Modules:
cache_rules.lua
- Configuration engine with YAML integrationcache_rules_reader.lua
- YAML parser with validationDocker & Configuration Changes
config.json
→auth_config.json
/app/
directoryCACHE_RULES_FILE
→/app/cache_rules.yaml
AUTH_CONFIG_FILE
→/app/auth_config.json
closes #55