EMQX使用traefik ingress 暴露域名访问不显示404

环境

  • EMQX 版本:5.4
  • 操作系统版本: v1.31.2+k3s1

使用NodePort方式暴露18083端口可以正常访问,但配置Taefik Ingress之后访问显示404,查看容器日志报错如下

[warning] msg: unexpected_api_access, mfa: emqx_dashboard_not_found:init/2(25), request: #{bindings => #{},body_length => 0,cert => undefined,has_body => false,headers => #{<<“accept”>> => <<“text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7”>>,<<“accept-encoding”>> => <<“gzip, deflate”>>,<<“accept-language”>> => <<“zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6”>>,<<“cache-control”>> => <<“max-age=0”>>,<<“host”>> => <<“192.168.0.209”>>,<<“upgrade-insecure-requests”>> => <<“1”>>,<<“user-agent”>> => <<“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0”>>,<<“x-forwarded-for”>> => <<“10.42.0.1”>>,<<“x-forwarded-host”>> => <<“192.168.0.209”>>,<<“x-forwarded-port”>> => <<“80”>>,<<“x-forwarded-proto”>> => <<“http”>>,<<“x-forwarded-server”>> => <<“traefik-58fb69cd5-8dfn4”>>,<<“x-real-ip”>> => <<“10.42.0.1”>>},host => <<“192.168.0.209”>>,host_info => undefined,method => <<“GET”>>,path => <<“/emqx”>>,path_info => undefined,peer => {{10,42,0,66},34762},pid => <0.3971.0>,port => 80,qs => <<>>,ref => ‘http:dashboard’,scheme => <<“http”>>,sock => {{10,42,0,74},18083},streamid => 3,version => ‘HTTP/1.1’}

请分享一下你的 Ingress 的配置

image

我认为问题应该是 PathPrefix(‘/emqx’),改成 PathPrefix(‘/’) 试试