Nginx反向代理(proxy

系统教程 行业动态 更新时间:2024-06-14 16:59:47
Nginx反向代理(proxy_pass)不传递子文件夹(Nginx reverse proxy (proxy_pass) does not pass subfolder)

我想在子文件夹配置中运行应用程序Mattermost

https://www.example.com/mattermost/

location /mattermost/ { gzip off; proxy_set_header X-Forwarded-Ssl on; client_max_body_size 50M; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_pass http://localhost:8065/; }

使用此配置,我将传递给正确的应用程序,但应用程序无法识别子文件夹。 它试图服务器

https://www.example.com/static/style.css而不是https://www.example.com/mattermost/style.css并显示404错误。

如何使用nginx将子文件夹传递给反向代理?

I want to run the application Mattermost in a subfolderconfiguration like

https://www.example.com/mattermost/

location /mattermost/ { gzip off; proxy_set_header X-Forwarded-Ssl on; client_max_body_size 50M; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_pass http://localhost:8065/; }

With this configuration I'll get passed to the correct application but the application does not recognize the subfolder. It tries to server

https://www.example.com/static/style.css instead of https://www.example.com/mattermost/style.css and brings up a 404 error.

How can I pass also the subfolder to the reverse proxy with nginx?

最满意答案

我想要运行的应用程序是“Mattermost”。 正如我现在可以确认的那样,版本无法使用子文件夹

Mattermost Team Edition版本:3.0.0(3.0.3)

更多信息:

http://forum.mattermost.org/t/blank-page-when-installing-mattermost-with-nginx-proxy-pass-as-subdirectory/1604/8

更新:如上述论坛中所述,目前Mattermost无法进行子文件夹配置。

The application I wanted to get running was "Mattermost". As I now can confirm, the use as subfolder is not possible with the Version

Mattermost Team Edition Version: 3.0.0 (3.0.3)

Further information:

http://forum.mattermost.org/t/blank-page-when-installing-mattermost-with-nginx-proxy-pass-as-subdirectory/1604/8

Update: As confirmed in the forum above, a subfolder configuration is not possible with Mattermost right now.

更多推荐

本文发布于:2023-04-17 09:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/8f20f270c3d1bf173cede00fa29affef.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Nginx   proxy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!