Giter Club home page Giter Club logo

Comments (10)

jwilder avatar jwilder commented on May 13, 2024

Multiple ports are not currently supported in the current template but there is no reason why you could not have the template do that though. For 443, you probably need to get SSL certs setup as well. SSL support is not implemented yet.

from nginx-proxy.

cosminonnet avatar cosminonnet commented on May 13, 2024

Hi,

Can you please explain with more detail how I could achieve this? For example, I want to use the Docker image "sameersbn/gitlab" that exposes the ports 80 and 22 and have a "jenkins" container also. So the "nginx-proxy" should be able to redirect "gitlab.myserver.com" on port 80 and 22 and "jenkins.myserver.com" on port 8080 only.

Thank in advance for your help.

from nginx-proxy.

jwilder avatar jwilder commented on May 13, 2024

nginx-proxy won't work for proxying port 22 (ssh). For your web traffic on port 80 and 8080, you would just set an env variable VIRTUAL_HOST=gitlab.myserver.com and VIRTUAL_HOST=jenkins.myserver.com on the appropriate containers and run nginx-proxy on the same host. Provided your DNS is setup to point to those domain names to your host, nginx-proxy will route the traffice accordingly. When you start your jenkins and gitlab containers, don't bind them to the host port 80/8080, just let docker assign a host port.

from nginx-proxy.

cosminonnet avatar cosminonnet commented on May 13, 2024

Thanks a lot for the answer, it's very clear!

So, for the SSH, I'll just let "-p 22:22", so that the gitlab container exposes the port directly. I think that should work :)

Cheers!

from nginx-proxy.

jwilder avatar jwilder commented on May 13, 2024

That should work although you may need to change your host's SSH port to avoid a conflict.

from nginx-proxy.

cosminonnet avatar cosminonnet commented on May 13, 2024

One last question, to make sure I fully understand (I am kind of a newbie on all this):

So, if my gitlab container exposes the port like "-p 22:22", then I won't be able to connect to my physical server (let's say "myserver.com ") on SSH port 22 anymore, because the connection will actually be redirected towards the container. The solution is, as you suggested, to have a setting like "-p 10022:22" instead of the exact port binding.

I hope I got this right. Thanks again for your help ;)

from nginx-proxy.

jwilder avatar jwilder commented on May 13, 2024

Yes. Either the container uses port 22 on the host or the host's SSH daemon does. Only one can use it though.

from nginx-proxy.

cosminonnet avatar cosminonnet commented on May 13, 2024

Great! I really appreciate it!

from nginx-proxy.

timkendrick avatar timkendrick commented on May 13, 2024

@jwilder - am I right in thinking this won't solve the problem though, seeing as @cosminonnet needs to expose both ports 80 and 10022 on the same container?

Is this possible without changing the nginx configuration template?

from nginx-proxy.

timkendrick avatar timkendrick commented on May 13, 2024

Sorry, only just realised that you were suggesting routing port 22 directly without going through nginx-proxy. Good idea!

from nginx-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.