tickets #119101
openhttps://news.opensuse.org/tag/adaptablelinuxplatform gives 500 (internal server error)
0%
Description
Hi folks,
following an old link to
https://news.opensuse.org/tag/adaptablelinuxplatform
I was surprised for news.opensuse.org to respond with error 500
(internal server error).
That page might not exist, or not exist any more, but wouldn't that
be a 404?
That made me curious, and indeed https://news.opensuse.org/asdfa or
any other page does not exist results in 500? Some server config issue?
Thanks,
Gerald
Updated by hellcp almost 2 years ago
That config is out there, so you can take a look at it: https://code.opensuse.org/heroes/salt/blob/production/f/pillar/role/web_jekyll.sls it is quite complex, so I presume we are doing something wrong here
Updated by pjessen almost 2 years ago
- Category set to Core services and virtual infrastructure
- Private changed from Yes to No
Other requests also produce a 500, for instance:
/favicon.ico
/robots.txt
/rss
/category/
/category/distribution/derivatives/medical/
/category/distribution/edu-life/
/category/distribution/leap/
/category/distribution/tumbleweed/
/category/project/events/
/category/project/events/osc/
/category/project/mentoring/gsoc/
/category/project/page/3/
/category/wiki-2/page/2/
/wp-content/uploads (miscellaneous)
At a quick glance, they all appear to be 'not found', so like Gerald suggests, they really ought to produce a 404.
Some are just due to faulty content:
/2010/09/wp-content/uploads/2010/09/Lpi-lpi-logo2.png is referred to by "https://news.opensuse.org/2010/09/28/osc2010-sneak-peaks-take-an-lpi-exam-at-opensuse-conference-2010" due to a poor uri.
Looking at the error log:
2022/10/28 08:52:59 [error] 8102#8102: *2477262 rewrite or internal redirection cycle while internally redirecting to "/favicon.ico.html.html.html.html.html.html.html.html.html.html.html", client: 47.157.94.226, server: news.opensuse.org, request: "GET /favicon.ico HTTP/1.1", host: "news.opensuse.org"
Updated by pjessen almost 2 years ago
I am mostly an nginx newbie, but after doing some research, I made the following change:
# diff -u news.opensuse.org.conf.bkup news.opensuse.org.conf
--- news.opensuse.org.conf.bkup 2022-03-01 12:43:04.503567724 +0000
+++ news.opensuse.org.conf 2022-10-28 08:58:36.865969060 +0000
@@ -28,7 +28,7 @@
location / {
index index.html index.htm;
- try_files $uri $uri/index.html $uri.html;
+ try_files $uri $uri/ $uri.html =404;
}
if ($args ~* "feed=rss2") {
Please, could someone, who knows news.o.o and nginx, review the above.
Updated by hellcp almost 2 years ago
That change looks good to me, indeed it should end with =404
Updated by pjessen almost 2 years ago
hellcp wrote:
That change looks good to me, indeed it should end with =404
Thanks for reviewing it! Looking at the other sites:
101.opensuse.org
debuginfod.opensuse.org
get.opensuse.org
monitor.opensuse.org
planet.opensuse.org
search.opensuse.org
www.opensuse.org
yast.opensuse.org
they all have the same issue - a url that cannot be found causes a loop, and then a 500.
It would seem to be a Good Idea (R) to apply the same change to all of them? It would mean wasting less resources, and probably also reduced traffic (because e.g. search engines usually give up when they receive a 404).
Updated by cboltz almost 2 years ago
pjessen wrote:
- try_files $uri $uri/index.html $uri.html; + try_files $uri $uri/ $uri.html =404;
Extending try_files
with =404
makes sense, but I'd keep the other values and just append the =404
(unless you have a good reason for removing some values).
BTW: Changing this isn't too much work - if you update the web_static
and web_jekyll
roles, that will fix lots of our (sub)domains.
Updated by pjessen almost 2 years ago
cboltz wrote:
pjessen wrote:
- try_files $uri $uri/index.html $uri.html; + try_files $uri $uri/ $uri.html =404;
Extending
try_files
with=404
makes sense, but I'd keep the other values and just append the=404
(unless you have a good reason for removing some values).
Thanks for reviewing, Christian.
I thought it made sense to change $uri/index.html
to $uri/
to use the default index definition?
BTW: Changing this isn't too much work - if you update the
web_static
andweb_jekyll
roles, that will fix lots of our (sub)domains.
Hmm, I'll have a look, I guess I have to get used to this salt stuff.