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

nginx启动成功,客户端报错 #2

Open
YoungEffort opened this issue Sep 6, 2019 · 24 comments
Open

nginx启动成功,客户端报错 #2

YoungEffort opened this issue Sep 6, 2019 · 24 comments

Comments

@YoungEffort
Copy link

image

@a597873885
Copy link
Owner

service worker 并不会影响页面的加载,nginx配置了吗?

@YoungEffort
Copy link
Author

我觉得service worker 是不会阻塞页面加载的,但是又不知道代码咋个写的,不知道啥原因,ng配置了啊,但是不是按说明配置的,按说明配置我访问不到,ng报500错

@a597873885
Copy link
Owner

image
nginx配置是必须的,否则路由不到页面

@YoungEffort
Copy link
Author

我配置了啊,不是按照你这样配置的而已,否则也访问不到那个加载页面了,为啥你这边配置的是inde.htnl,文档写的访问home

@a597873885
Copy link
Owner

@YoungEffort 发一下你的配置

@YoungEffort
Copy link
Author

YoungEffort commented Sep 6, 2019

配置:
image
文件所在位置:
image

@a597873885
Copy link
Owner

按照文档配置Nginx,否则路由是无法生效的。 你这样的配置只是能访问到index.html, 项目的路由无法生效,也就自然看不到对应页面了

@YoungEffort
Copy link
Author

可以看一下完整的ng配置文件么,我配置了ng报500

@a597873885
Copy link
Owner

我把配置文件上传了,你拉取新的代码,根目录下就可以看到了

@YoungEffort
Copy link
Author

访问url:
image
ng报错:
image
配置root修改:
image

@a597873885
Copy link
Owner

server {} 是否放在了http的节点下, 或者先把我的nginx.conf文件 整个拷贝过去用用看

@YoungEffort
Copy link
Author

YoungEffort commented Sep 6, 2019

我是把你的配置文件整个拷过去改的,防止不一致

只修改了root配置

@a597873885
Copy link
Owner

你这样试一下,直接访问 http://localhost:8010/webfunny/index.html
看看能否访问通

@YoungEffort
Copy link
Author

感谢耐心解答,我找到解决方案了,是多个nginx进程跑着的,我全部关闭,重启解决问题了,再次感谢

@a597873885
Copy link
Owner

a597873885 commented Sep 6, 2019

其实我一直想问你是否重启了,只是没好意思问,哈哈,记着配置文件每次的改动,都要重启nginx的

@YoungEffort
Copy link
Author

YoungEffort commented Sep 6, 2019

不是没有重启,是跑了很多nginx服务,我每次都重启了,我就是感觉自己配置没问题,怀疑了nginx配置没生效

然后发现很多人都遇到了nginx配置重启不生效问题

@a597873885
Copy link
Owner

哈哈,解决了就好,继续加油

@YoungEffort
Copy link
Author

我也跑了你的后台服务,8g内存,cpu直接占满,有解决办法么

@a597873885
Copy link
Owner

我本地是mac系统,跑起来几乎无影响,你的是什么系统?

@YoungEffort
Copy link
Author

windows

@a597873885
Copy link
Owner

@YoungEffort 这个问题我关注一下,等我找时间确认一下

@YoungEffort
Copy link
Author

我需要关闭不

@a597873885
Copy link
Owner

等我看下原因吧

@YoungEffort
Copy link
Author

好的

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