I’m currently working on a project using LXD, Elasticsearch, Logstash, and Nginx as a reverse proxy for accessing Kibana.
I’m having a bit of trouble trying to access a Nginx instance running inside my LXD container.
I’ve tried the following without success:
- LXD 2.0 on Ubuntu 16.04 within VirtualBox for easy LAN access - 10 minutes guide
- How to access webserver running in container from outside of my host?
I’m able to access services running in the LXD container on the Ubuntu host inside VirtualBox. However, I do not have connectivity to the LXD container from my physical machine (MacBook).
Ideally, I’d like to be able to give each LXD container an IP address on my LAN, which should allow me to ssh into each container and access Nginx, Kibana, etc., from my physical machine (MacBook).
I hope the following information is useful. If more info is needed, just let me know.
Thank you for reading!
The Nginx config inside the LXD container is:
server {
listen 80 default_server;
server_name _;
return 301 https://$server_name$request_uri;
}
server {
listen 443 default_server ssl http2;
server_name _;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
ssl_session_cache shared:SSL:10m;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.kibana;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}