LXC容器的NGINX反向代理 基本情景:

LXC容器的NGINX反向代理 基本情景:,nginx,reverse-proxy,Nginx,Reverse Proxy,我有一个运行Proxmox的(物理)服务器 在这个硬件上,我运行LXC容器(我们称之为100101…),所有这些都是NGINX启动的 我的目标是: 配置容器100,使其充当所有其他容器的反向代理 当前配置: 在容器100上(反向代理) 在容器101上,目标之一 # This is a default site configuration which will simply return 404, preventing # chance access to any other virtualh

我有一个运行Proxmox的(物理)服务器

在这个硬件上,我运行LXC容器(我们称之为100101…),所有这些都是NGINX启动的

我的目标是: 配置容器100,使其充当所有其他容器的反向代理

当前配置:
  • 在容器100上(反向代理)

  • 在容器101上,目标之一

    # This is a default site configuration which will simply return 404, preventing
    # chance access to any other virtualhost.
    
    server {
    listen 80 default_server;
    
    # Everything is a 404
    location / {
            return 404;
    }
    
    # You may need this to prevent return 404 recursion.
    location = /404.html {
            internal;
    }
    }
    
这两个容器都有一个静态IP,100个get是192.168.178.100,101个get是192.168.178.101

我可以通过浏览器的IP访问101,但无法访问100

这是我第一次建立这样的网络,请原谅我犯的任何愚蠢的错误

# This is a default site configuration which will simply return 404, preventing
# chance access to any other virtualhost.

server {
listen 80 default_server;

# Everything is a 404
location / {
        return 404;
}

# You may need this to prevent return 404 recursion.
location = /404.html {
        internal;
}
}