我可以通过 http://homestead.test 访问 vagrant 中的 Web 服务器。 但是有些静态文件是Vite编译的,应该可以通过http://127.0.0.1:5173访问。 所以我在 Homestead.yaml 中添加端口
ports:
- send: 33060 # MySQL/MariaDB
to: 3306
- send: 5173
to: 5173
失败。最奇怪的是我可以从mac通过33060连接mysql,这意味着端口转发正在工作。那么,为什么 5173 会失败?
iptables -L
什么都没出来
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (1 references)
target prot opt source destination
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere