-
Notifications
You must be signed in to change notification settings - Fork 3k
SSH and HTTPS Support? #344
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
Comments
I am already forwarding SSH with streams, would this help you? |
Hi there Would that be possible with the streams in the UI? Can you set the stream again on port 443? It would be important that only one port is present on the outside. |
Is that even possible, @FantaBlueMystery ? |
yes clearly see my first post, currently I have another nginx before npm that uses this config and on 'server 10.8.0.15:443;' forward to the npm :) |
Hi @FantaBlueMystery, did you know ShellHub? I think you can configure NGINX Proxy Manager to work together ShellHub for SSH access. I'm doing some tests with NGINX Proxy Manager and ShellHub to provide HTTPS access. |
Hello @gustavosbarreto thanks for the info, I didn't know "shellhub" until now. It looks very interesting e.g. with "web-based user interface". But here it would also be the case that it should be accessible using the SSH protocol. As an example, we would use sftp or the Ansible program. But I'll still have a look at "shellhub". But I think to get the destination a port on the router you still can't get without the settings like in my first post. Port 22 (or another ssh port) should not be visible from the outside. Therefore, a camouflage via https (443) is ingenious, since you can determine the HTTPs server and SSH in the internal network at the same time based on the domain (subdomaining). |
Has there been any advancement on this enhancement? |
How do you achieve this? which docker image you use for your head Nginx with streams? |
Hey @ursus69 sorry for my late answer: docker-compose.yml
Edit your nginx.conf and add:
Simple and fast :) |
Many thanks @FantaBlueMystery, I t works like a charm! |
This is an exiting enhancement!!! It would add an extra layer of security for my network! |
Do you know when this new enhancement will be available in the docker NPM image? thanks in advance for the wonderful development!! |
I don't think this code snippet will ever be officially added to NPM unless someone creates a pull request adding this and creating a user interface where this is configurable. As it is now, this is very specific for one ssh server, and the file would have to be edited manually anyways, so there is no point in adding it. You would have to add this nginx config inside your container yourself. |
This comment make me kind of sad, but its acceptable. I get an alternative. For ssh with WebRender you can use this guide: This To use the setup with the ssh cli (ProxyJump) you can use this And, of you think this offers you a ProxyJump to far away when your locally you can use this amazing blog KEEP IN MIND that this heavely relies in Cloudflare/LetsEncrypt DNS certificates and (in this instruction) Docker. |
We just need a way to enter/edit the |
Hello everyone, I'm a big fan of NPM! I've started to write my own software for this implementation and I'm still looking for testers, whoever is interested can take a look at the whole thing. I'm just posting this because the idea isn't being picked up. The whole thing is still under development. I use it for myself already in a live test. You can find it through my profile. |
Can this feature be used to enable SSH support? Would the streams feature come into play? I'm hoping to only have ports 80/443 open on my firewall but I want to be able to SSH and host some https sites. https://nginxproxymanager.com/advanced-config/#custom-nginx-configurations |
@marky421 I do not fully understand the question. The example above shows how an SSH protocol can be placed over the HTTPS port. Magic :) |
Issue is now considered stale. If you want to keep it open, please comment 👍 |
@
See my reply in the linked thread here: #646 (comment) tl;dr is you can use This can, however, be easily accomplished with a standalone (non-NPM) nginx install on a linux server or small docker instance as I explain in the message linked above. |
@albeec13 Why are you reposting an answer that has been clarified for a long time? Your example, which came later, explains the same context. It's clear that if npm doesn't build an interface for this, this issue will only be closed if it is rejected. That's okay too. Then you can put your own config or a pre-nginx in front of it. :) |
I was running into a similar problem and decided to respond to this existing thread instead of starting a new one. Moreover, there were two important distinctions between my response and others I've seen which are:
I felt these were important/useful to the next person who may run into this issue. If it's not of use to you, no need to snark about it. |
@albeec13 Okay, I understand, then we got off on the wrong foot.
Apart from npm, this is possible and this is also what my app is aiming for. As with the 443 port, you also carry out “domain splitting” on the 80 port, i.e. a map to different upstreams. For example, all domains that point to the 80 port are directed to the upstream 127.0.0.1:10080. There the 10080 waits for a response depending on the domain with
each of these "servers" has a location /.well-know/ entry. Now you could ask yourself how the original client IP gets to the server. This is also easy, in the
"proxy_protocol" is activated and on the
Activated. Now the client IPs will also be passed on. |
No worries!
I'll have to check that out, thanks!
Cool, I was not aware of the proxy_protocol directive, I'll need to look into that some more. Thanks! |
I'm trying to achieve this using a custom/stream.conf, but looks like i'm missing something.
This is my custom/stream.conf file, for the ssh upstream i use the docker IP which i can connect to using the shell from the NPM container:
Thanks a lot for any help you can give me, it'll be really appreciated
|
I've created an overview of the route for you. If no suitable domain is specified, your browser will default to "ssh," which it won't be able to do (it won't understand because it's an SSH protocol). "https" upstream is empty and cannot be reached. On the upstream "ssh," I see that you're specifying port "8443," which not sounds like the SSH server. Please check this again; the normal SSH port is 22. If there's a web server behind 8443, it won't understand SSH and will respond with a "Bad Request." I hope this helps you. |
Hi Stefan, thanks for the provided oveview. On the ssh upstream i specified the 8443 port because the service it's listening on a custom port :) At the momento i'm not trying to reach an https service via browser, i'm trying just the SSH connection Thanks again for getting back to me
|
@komodikkio
Based on the answer, we can rule out whether there is another configuration for the 443 |
@stefanwerfling Running netstat on the host:
If i try to open it, from the host or from the container, using the browser or curl, i get an error:
On the 80/tcp port i find the default page of nginx stating: "Congratulations! You've successfully started the Nginx Proxy Manager." 2.2 tryed to map http2 to the NPM management page at :81, but can't get it work. I think because that's http only I don't know what's going on but i'm thinking that, even if I could make it work, loosing the chance to use NPM's gui for managing websites and SSL certificates makes it a bit "wasted" |
@komodikkio Process: The router redirects the 443 port from the public IP to 9443, which splits the protocol and redirects it internally to 443. 443 is not listed externally (it is not published in Docker).
$ssl_preread_server_nam You can leave it out, because It is take care of the names, unless you have a server that issues itself a certificate with Let's Encrypt, in which case you'll need this block. Then you can also point it to your NPM 443 by default. Problem: You now have 9443 as your pre-proxy, so you're losing the client's IP address because the server always shows 127.0.0.1 as the client's IP address. To fix this, you need to enable the proxy protocol. The link tells you what you need to do. But you'll also need to find the 443 config again, where you configure it so that you now receive everything with the proxy protocol header. good luck! :) |
Can you add SSH Support? (Nice to have)
For example by my SSH-Proxy
The text was updated successfully, but these errors were encountered: