Nginx错误页面没有加载静态内容

运行Nginx 1.4.1我有下面的configuration来显示一个自定义的错误页面,以防我的后端弄乱了。 该页面显示,但自定义字体和图像不加载。 我的自定义错误页面(50x.html)位于/ usr / share / nginx / html /中。 子文件夹中的静态内容img&fonts。

从我的浏览器,我可以看到,静态内容url附加到我目前的url,使其不可用。 例如,如果我浏览www.domain.com/user/account,Nginx将尝试从服务器加载内容:

URL /user/account/img/logo.png /user/account/img/main.jpg /user/account/img/footer.png /user/account/fonts/miso-regular-webfont.ttf 

而不是从sr / share / nginx / html / img /

这里是configuration部分:

 error_page 324 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; allow all; internal; } 

感谢您的灯光。

编辑1:

谢谢阿列克谢,path现在纠正,但图像仍然不显示。 在最初的后端故障中,Nginx尝试从Apache获取图像,而Nginx应该服务整个维护页面,而不依赖于后端。 为什么这种行为? 当一个backen生病时,我不能依靠它,即使是一个维护页面。

谢谢。

解决以下问题:

 error_page 324 500 502 503 504 = @maintenance; location @maintenance { root /usr/share/nginx/html; try_files $uri /50x.html =503; }