Hi,
I have a computer that also functions as server (for now).
I’m using lxd containers for webservers.
I would like to connect to the containers on computer on my home network, but also from the computer/server.
I have good experiences with macvlan to expose the containers to the network.
However you can’t connect to the container from the server.
So I setup a fan bridge. Containers have ip adress 240.93.0.XXX and are online.
I would like to use Nginx as proxy the webservers of the containers to certain weblocations. Nginx is installed on the host.
Try visiting mydomain.com/test/ or http://[your host ip here]/test/
if you see the page, that worked.
Point to note : make sure that there is something listening inside the container on port 80 ( For example nginx or apache). As you didn’t mention what port, the proxy_pass isn’t working.
I didn’t quiet understand what you mean by this :
I have a similar setup where I use upstream to proxy traffic from my host to the containers.
You can setup proxy rules to pass ssh traffic on different ports of your host ip to the containers to access them using iptables. (Maybe adding a device proxy as well, but I haven’t tried proxying ssh into containers using the proxy settings mentioned here
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
container test
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
host
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
curl 192.168.1.93/test
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>
curl 192.168.1.93/test/
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>