Answer the question
In order to leave comments, you need to log in
How to create subdomain for lxd container?
I have lxc on my server. Each lxc has a different resource. I forward each resource to the network through nginx. Here's how:
upstream name-container {
server ип контейнера:(порт какой надо пробросить);
}
server {
listen domen:(порт на который пробросить);
proxy_connect_timeout 3600s;
proxy_timeout 3600s;
proxy_pass name-container;
}
Answer the question
In order to leave comments, you need to log in
Virtual host config for one subdomain:
server {
listen 80;
server_name subdomain.example.com;
access_log /var/log/nginx/subdomain.example.com-access.log;
error_log /var/log/nginx/subdomain.example.com-error.log;
location / {
proxy_pass http://192.168.13.31:85;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question