digitalocean / nginxconfig.io

⚙️ NGINX config generator on steroids 💉

Home Page:https://do.co/nginxconfig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow to add stream entry

d0niek opened this issue · comments

Feature request

Feature description

As we have Add site button, it would be nice to have Add stream button. File nginx.conf will look like:

// ...
http {
    // ...
    include /etc/nginx/sites-enabled/*;
}
stream {
    // ...
    include /etc/nginx/streams-enabled/*;
}

How the feature is useful

It is really good for reverse proxy. I run all apps as docker containers and some of them are not a http. For example git repository is ssh. Previous I had to expose container port to public host_port_public:container_port, with "stream reverse proxy" I can keep my containers not public 127.0.0.1:host_port_local:container_port.

My nginx.conf looks like:

// ...
http {
    // ...
}
stream {
    upstream ssh {
        server 127.0.0.1:host_port_local;
    }

    server {
        listen host_port_public;
        proxy_pass ssh;
    }
}

I don't know if there are some general configs for streams like for http (nginxconfig.io/*) or each stream has to have individual settings.