gonginx
gonginx copied to clipboard
[feature request]enhanced server object capabilities for easier access and modification of nginx configuration
propose to enhance the server object by adding new attributes and methods that will simplify the access and modification of its listening configuration, location details, and other pertinent settings. The following are potential enhancements and features that could be incorporated:
// get server by servername
server := conf.GetBlock(*.config.HTTP).GetServerByServerName("example.com")
// get all listening ports for the server
listenPorts := server.GetListenPorts()
// change the first listen port configuration to 8080
server.Listens[0].SetListenPort(8080)
// retrieve all location configurations for the server
locations := server.GetLocations()
Please consider implementing these functionalities to streamline working with complex server configurations and encourage more robust and dynamic management of Nginx setup through this library.
Let's discuss the feasibility and potential implementation details for these enhancements under this issue thread.
sounds good, would you like to take this?
I would like to develop these features. Some of the features have already been implemented in the project I am working on. After the completion of the subsequent work, I will submit a Pull Request.
awesome! looking forward to it!