nginx 502错误

tech2022-08-30  133

nginx 502错误

This doesn’t apply to you if you’re using Apache to do local development

如果您使用Apache进行本地开发,则这不适用于您

I was doing some local dev work recently, but for the first time in my “new” browser – Opera. I set up my Homestead Improved instance and its virtual hosts as usual, but then couldn’t get anything other than a 502 error to show up:

我最近在做一些本地开发工作,但是这是我第一次使用“新”浏览器Opera。 我像往常一样设置了Homestead Improvementd实例及其虚拟主机,但是除了显示502错误外,什么也没得到:

If you inspect the dev tools, you’ll notice the status is 502 – typical of an Nginx bad gateway error.

如果您检查开发工具,则会注意到状态为502 –典型的Nginx网关错误。

I then spent around 30 minutes starting at dead empty error logs in my VM, and re-checking the PHP socket and ports, until it hit me that I was looking in the wrong place:

然后,我花了大约30分钟,从我的VM中的空错误日志开始,然后重新检查PHP套接字和端口,直到发现我在错误的位置发现它:

Opera has VPN on by default in the version that’s current at the time of this writing, and when you try to visit a valid TLD (.com, .app, .dev, etc) with the VPN on, it crashes. The error you see is the one from Opera’s VPN which is, incidentally, running Nginx.

在撰写本文时,Opera默认启用了当前版本的VPN,当您尝试使用VPN来访问有效的TLD(.com,.app,.dev等)时,它会崩溃。 您看到的错误是Opera的VPN中的一个错误,该错误是正在运行Nginx。

To solve the issue, all one has to do is turn off the VPN during local development and it’ll work.

为了解决这个问题,所有要做的就是在本地开发过程中关闭VPN,它会起作用。

Hope this helped someone avoid more unnecessary log hunting.

希望这有助于某人避免更多不必要的日志搜寻。

翻译自: https://www.sitepoint.com/local-development-with-opera-nginx-502-error/

nginx 502错误

最新回复(0)