NginxProxyManager / nginx-proxy-manager

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

[Feature Request] Allow fully custom configs (To allow stream SSL termination) #2542

Open devedse opened 1 year ago

devedse commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to create a reverse-proxy for a TCP stream that is encrypted with a certificate. (E.g. the NNTP protocol does this).

Describe the solution you'd like Basically create a 'stream' or something with a custom nginx config:

upstream stream_backend {
  server ********:563;
}

server {
  listen                563 ssl;
  proxy_pass            stream_backend;
  proxy_ssl  on;

  ssl_certificate /etc/letsencrypt/live/npm-9/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/npm-9/privkey.pem;

  proxy_ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
  proxy_ssl_ciphers             HIGH:!aNULL:!MD5;
}

Describe alternatives you've considered I could run another Nginx host but I want to run everything in the nginx-proxy-manager

Additional context By manually modifying the file: /data/nginx/stream/6.conf I was able to get this working. This however will break the next time I modify this through the UI.

devedse commented 1 year ago

Any way this could be implemented?

simqui commented 1 year ago

See: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1829

devedse commented 1 year ago

@simqui , ah nice. I hope either that one or just support for custom configs van be implemented.

amoshydra commented 1 year ago

It is possible to use custom stream config by writing into data/nginx/custom/stream.conf

This is the content of my stream.conf

upstream dns-servers {
    server    192.168.0.2:53; # IP to my DNS server 
}

server {
    listen 853 ssl;
    proxy_pass dns-servers;

    # using existing cert
    ssl_certificate /etc/letsencrypt/live/npm-1/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem;

    ssl_protocols        TLSv1.2;
    ssl_ciphers          HIGH:!aNULL:!MD5;

    ssl_handshake_timeout    10s;
}

Reference:


if you are using docker-compose, make sure to add port 853:853 and run docker-compose up -d again

lesca commented 1 year ago

Using custom conf brings issues if the cert is changed, and somehow forget to update the custom settings. It could be a workaround but finally I expect the support from official, and within UI.

github-actions[bot] commented 7 months ago

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