Comments (10)
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.
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.
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.
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.
That should work although you may need to change your host's SSH port to avoid a conflict.
from nginx-proxy.
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.
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.
Great! I really appreciate it!
from nginx-proxy.
@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.
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)
- phpipam + nginx-proxy = connection refused
- Broken testcase test/test_host-network-mode/test_host-network-mode.py HOT 1
- SSH Certificates will Not Update HOT 1
- HTTP/2 Rapid Reset Attack HOT 2
- Unable to download python requirements for testing HOT 1
- default.conf config file formatting corrupted and hardly readable (nginx -T) HOT 1
- Issue with Bookstack urls being re-written to http not https HOT 2
- 403 Forbidden error when serving static site HOT 1
- Cannot reach container in IPv6 network HOT 4
- Regression in Behavior with Fix #2186 Affecting SSL Connections HOT 9
- "daemon" directive is duplicate in /etc/nginx/nginx.conf error HOT 3
- connect() failed (111: Connection refused) while connecting to upstream HOT 2
- vhost.d for http part
- 502 Bad Gateway & Upstream connection refused HOT 5
- host header does not include port number HOT 2
- `nginx-proxy` pass converting `%1C` to pipe `|` HOT 1
- 405 (cors error) on specific location
- The server connection via port 443 fails when using PHP 8.1 or above HOT 2
- Error 500 On Service Start
- htpasswd folder doesn't work anymore / no basic auth HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-proxy.