Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行提示端口了,但是无法访问 #52

Open
AndyNull opened this issue Sep 22, 2023 · 4 comments
Open

运行提示端口了,但是无法访问 #52

AndyNull opened this issue Sep 22, 2023 · 4 comments

Comments

@AndyNull
Copy link

服务器拉取文件,然后运行提示:
VITE v3.2.7 ready in 1373 ms

➜ Local: http://localhost:5173/
➜ Network: use --host to expose

但是ip加端口无法访问,端口也放行了,但是端口并没有被占用...

@htfc786
Copy link
Contributor

htfc786 commented Oct 5, 2023

使用ip访问需要在package.json文件里scripts项里面的dev那行改成vite --host 0.0.0.0,对全部地址开放

@htfc786
Copy link
Contributor

htfc786 commented Oct 5, 2023

“端口放行”:是服务器部署吗?服务器部署直接运行npm run build构建文件,在dist目录里,在服务器上安装nginx服务器,使用静态网页服务器,history模式别忘了加上try_files

@AndyNull
Copy link
Author

AndyNull commented Oct 5, 2023

目录

哈哈,之前已经搞定了,看了下vue的教程

@htfc786
Copy link
Contributor

htfc786 commented Oct 5, 2023

好的👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants