-1

I can access the web server in vagrant via http://homestead.test. But some static files is compiled by Vite, which should be access by http://127.0.0.1:5173. So I add ports in Homestead.yaml

ports:
    - send: 33060 # MySQL/MariaDB
      to: 3306
    - send: 5173
      to: 5173

Fail. The most weird thing is that I can connect mysql via 33060 from mac, which means port forwarding is working. Then, why 5173 fails?

iptables -L comes out nothing

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
1
  • I’m voting to close this question because from the vagrant tag: GENERAL VAGRANT SUPPORT IS OFF-TOPIC. Support questions may be asked on superuser.com. Please delete this. Commented Mar 16, 2023 at 12:49

1 Answer 1

0

Maybe it's because you have the same port number on both sides. What if you try to change one of them? Regarding MySQL/MariaDB, the first port is 33060, and the second is 3306, and it works. So,I would try it first. Hope this helps! :)

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.