NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.2k stars 2.69k forks source link

Configuration as Code : List of Proxy Hosts or Import Capability #2695

Open instantdreams opened 1 year ago

instantdreams commented 1 year ago

Is your feature request related to a problem? Please describe. My various servers use repositories to manage the configuration, including but not limited to:

The ability to define proxy hosts in a yaml or toml file that are automatically imported if not existing into an instance of NPM would save time, but more importantly provide robustness and repeatability in the event of having to fully rebuild a host.h

I run NPM on two edge servers, with scripts to backup and restore the configuration and database if needed, but an initial load would certainly help with 50+ proxy hosts.

Describe the solution you'd like Support for a nginx-proxy-manager.yml file in a suitable mapped folder with an example format of:

hosts-proxy:
  - domain-names:
    - [domain name 1]
    - [domain name x]
    scheme: [http | https]
    forward-host-ip: [hostname | ip address]
    foward-port: [port]
    cache-assets: [true | false]
    block-common-exploits: [true | false]
    websockets-support: [true | false]
    access-list: [access list]
    location: 
      - path: [path]
        scheme: [http | https]
        forward-host-ip: [hostname | ip address]
        foward-port: [port]
        [custom-configuration]: [not allowed with initial load]
    ssl-certificate:
      - request: [true | false]
        force-ssl: [true | false]
        http2-support: [true | false]
        hsts-enabled: [true | false]
        hsts-subdomains: [subdomains]
        email-address: [email]
        agreement: [true]    
    [custom-configuration]: [not allowed with initial load]

hosts-redirection:
  - [etc]

hosts-streams:
  - [etc]

Other clauses can be defined for Redirections, Streams, and 404s, but no DNS challenges or access list changes should be considered. This would be in order to perform the initial population of a fresh installation.

Describe alternatives you've considered

  1. Backup and Restore
    • Only useful when recovering or reimaging an existing location
  2. Duplicate existing data/nginx/proxy_host/*.conf files
    • Risky without knowing integration to NPM processes

Additional context This would be a nice to have feature. The existing functionality of NPM make it worth using even if everything has to be set up from scratch with detailed documentation, rather than configuration as code.

github-actions[bot] commented 9 months ago

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

instantdreams commented 9 months ago

Issue is still relevant.

In the meantime, Traefik Hub with service discovery via labels provides configuration as code options.

github-actions[bot] commented 6 days ago

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