依赖项更新后不再可访问前端

发布于 2025-01-31 13:50:51 字数 1577 浏览 0 评论 0原文

我们有一个相当标准的Web应用程序,其中包括一个烧瓶后端和一个vue.js前端。在生产中,我们使用UWSGI为该应用程序服务。我们已经配置了UWSGI为前端页面提供服务,并访问其各自路线的后端呼叫。

[uwsgi]
module = app
callable = create_app()
buffer-size=65535
limit-post=0
wsgi-disable-file-wrapper=true
check-static=./public

# enable threads for sentry
enable-threads = true

# dont show errors if the client disconnected
ignore-sigpipe=true
ignore-write-errors=true
disable-write-exception=true

; redirect all frontend requests that are not static files to the index
route-host = ^$(FRONTEND_HOST_NAME)$ goto:frontend
; also handle if the host name is frontend, for the dokku checks
route-host = ^frontend$ goto:frontend

; continue if its a backend call
route-host = ^$(BACKEND_HOST_NAME)$ last:
route-host = ^backend$ last:

; log and abort if none match
route-run = log:Host Name "${HTTP_HOST}" is neither "$(FRONTEND_HOST_NAME)" nor "$(BACKEND_HOST_NAME)"
route-run = break:500

route-label = frontend
route-if = isfile:/app/src/backend/public${PATH_INFO} static:/app/src/backend/public${PATH_INFO}
route-run = static:/app/src/backend/public/index.html

这效果很好,表现得像我们的开发设置一样,我们在前端和后端都使用容器。但是,在更新一些脆弱的依赖项之后,尝试访问前端的结果为404。

在前端,我们从vue-cli 〜4.5.9转移到〜5.0.4。我们长期以来怀疑这可能是主要问题,但是我们不再那么确定了。

我们还从烧瓶〜1.1升级到^2.0.3,但我们保留了UWSGI的版本2.0。因此,其配置可能不会更改。

我们在黑暗中踩踏。你们中有人对这里可能出了什么问题有任何想法吗?

我试图通过创建一个相当小的设置,但无法追踪该问题,但无法追踪该问题,但无法追踪该问题,但无法追踪该问题,但是迄今为止的基本问题。

We have a rather standard web app, that consists of a Flask backend and a Vue.js frontend. In production, we use uWSGI to serve that application. We have uWSGI configured to serve frontend pages and access backend calls for their respective routes.

[uwsgi]
module = app
callable = create_app()
buffer-size=65535
limit-post=0
wsgi-disable-file-wrapper=true
check-static=./public

# enable threads for sentry
enable-threads = true

# dont show errors if the client disconnected
ignore-sigpipe=true
ignore-write-errors=true
disable-write-exception=true

; redirect all frontend requests that are not static files to the index
route-host = ^$(FRONTEND_HOST_NAME)$ goto:frontend
; also handle if the host name is frontend, for the dokku checks
route-host = ^frontend$ goto:frontend

; continue if its a backend call
route-host = ^$(BACKEND_HOST_NAME)$ last:
route-host = ^backend$ last:

; log and abort if none match
route-run = log:Host Name "${HTTP_HOST}" is neither "$(FRONTEND_HOST_NAME)" nor "$(BACKEND_HOST_NAME)"
route-run = break:500

route-label = frontend
route-if = isfile:/app/src/backend/public${PATH_INFO} static:/app/src/backend/public${PATH_INFO}
route-run = static:/app/src/backend/public/index.html

This worked perfectly fine and behaved just like our dev setup, where we use containers for both front- and backend. But after the update of some vulnerable dependencies, trying to access the frontend results in a 404.

In the frontend we moved from vue-cli ~4.5.9 to ~5.0.4. We long suspected that this might be the main issue, but we're not so sure about that anymore.

We also upgraded from Flask ~1.1 to ^2.0.3 but we kept the version 2.0 of uWSGI. The configuration of that should therefore probably not have changed.

We're treading in the dark on this one. Does anyone of you have any idea on what might be going wrong in here?

I tried to isolate the problem by creating a rather small setup, but have not been able to track down the underlying issue until now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我鬧 2025-02-07 13:50:51

我不知道那是什么,但是最终我逐一升级了每个依赖关系,直到所有依赖性都升级并且事情仍然有效。它一定与我们使用的Dockerfile有关。现在,那个更像是旧的,而不是我以前用来一个一个人做事的那个。

I have no idea what it exactly was, but I did in the end upgrade each dependency one by one until all of them were upgraded and things still worked. It must have been something related to the Dockerfile that we use. That one is now slightly more like the old one rather than the one I used previously to doing things one by one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文