Networking 504尝试登录到laravel项目时网关超时

Networking 504尝试登录到laravel项目时网关超时,networking,laravel-5,server,load-balancing,haproxy,Networking,Laravel 5,Server,Load Balancing,Haproxy,我有一个LaravelV5.2项目,我的pc环境是ubnuntu(主机) 项目在虚拟机上,虚拟机配置如下: 有一个haproxy来加载两个relplia集,它们也是ubuntuvm 项目位于我的pc主目录中,我已通过此副本集共享了该目录。 每个请求都发送到haproxy,然后它将负载平衡请求发送到这两个副本集 haproxy网络配置是网络中其他用户可以访问的网桥(静态ip) 这两个副本集网络配置仅用于与haproxy对话的NAT 我使用此配置没有问题,但在我更改电脑的internet连接后,当我

我有一个LaravelV5.2项目,我的pc环境是ubnuntu(主机)

项目在虚拟机上,虚拟机配置如下:

有一个haproxy来加载两个relplia集,它们也是ubuntuvm

项目位于我的pc主目录中,我已通过此副本集共享了该目录。 每个请求都发送到haproxy,然后它将负载平衡请求发送到这两个副本集

haproxy网络配置是网络中其他用户可以访问的网桥(静态ip)

这两个副本集网络配置仅用于与haproxy对话的NAT

我使用此配置没有问题,但在我更改电脑的internet连接后,当我更新所有ip地址和配置时,我无法再登录到我的项目,当我尝试登录到我的项目时,我得到:

504 Gateway Time-out

The server didn't respond in time.
奇怪的是,当我尝试使用手动创建的令牌获取用户信息时:没有问题,我可以获取用户信息数据或任何其他路由数据

问题在于登录、注册路由。当我使用以前的互联网连接时,我没有这个问题

我将在下面描述我的虚拟机和网络配置:

我的电脑(主机)网络配置:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eno1
iface eno1 inet static
        address 192.168.30.245
        netmask 255.255.255.0
        network 192.168.30.0
        gateway 192.168.30.1
        dns-nameservers 8.8.8.8
我的电脑(主机)/etc/hosts:

192.168.30.236  api.project.local
HAproxy虚拟机网络:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

address 192.168.30.236
netmask 255.255.255.0
network 192.168.30.0
broadcast 192.168.30.255
gateway 192.168.30.1

auto eth1
iface eth1 inet static

address 192.168.100.113
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

address 192.168.100.110
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

address 192.168.100.110
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
复制副本设置为网络:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

address 192.168.30.236
netmask 255.255.255.0
network 192.168.30.0
broadcast 192.168.30.255
gateway 192.168.30.1

auto eth1
iface eth1 inet static

address 192.168.100.113
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

address 192.168.100.110
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

address 192.168.100.110
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
复制集B网络:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

address 192.168.30.236
netmask 255.255.255.0
network 192.168.30.0
broadcast 192.168.30.255
gateway 192.168.30.1

auto eth1
iface eth1 inet static

address 192.168.100.113
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

address 192.168.100.110
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static

address 192.168.100.110
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 10.0.2.15
Mysql和mongodb服务器位于我的本地pc(主机)上,其ip为:
192.168.30.245


正如我所说,从其他
路由
artisan tinker
连接mysql或mongodb服务器没有问题,我已经设法解决了这个问题,问题是由于我的网络更改和网关更改

对于具有这种网络配置的任何人,他们都应该知道,如果您有一个负载平衡器和两对副本集,那么您必须为所有副本集定义相同的网关,它可以是调制解调器或路由器,以便能够解析每台服务器和操作系统以及mysql和mongodb引擎

如果您注意到,我为所有这些服务器定义了相同的网关,但因为它是isp直接无线的,并且isp启用了dhcp,所以这些服务器无法相互解析,因为它们将通过NAT,而NAT也位于isp端