Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"404" pages on stats.jenkins.io served with 200 OK status code #4291

Closed
chris48s opened this issue Sep 14, 2024 · 4 comments
Closed

"404" pages on stats.jenkins.io served with 200 OK status code #4291

chris48s opened this issue Sep 14, 2024 · 4 comments

Comments

@chris48s
Copy link

Service(s)

stats.jenkins.io

Summary

Example: https://stats.jenkins.io/plugin-installation-trend/not-a-plugin.stats.json
Would it be possible to serve these with a 404 Not Found status in the headers?

Reproduction steps

curl --include "https://stats.jenkins.io/plugin-installation-trend/not-a-plugin.stats.json"
@dduportal
Copy link
Contributor

Looks like this issue is a combination of 2 things:

@dduportal dduportal removed the triage Incoming issues that need review label Sep 16, 2024
@dduportal dduportal removed their assignment Sep 17, 2024
@lemeurherveCB
Copy link

This behavior seems to always have been the same even before the fix.
Ex: https://stats.jenkins.io/notanurl

I'm not sure to follow, can you explain what you mean by "the merge of files following the migration"?

@dduportal
Copy link
Contributor

This behavior seems to always have been the same even before the fix. Ex: https://stats.jenkins.io/notanurl

Before adding the try_files, Nginx was acting as a standard HTTP server: if the requested resource does not exist on the filesystem, then it answers HTTP/404. That was the case with https://stats.jenkins.io/notanurl (you can test it locally if you want).

Adding the try_files added changed the default behavior to "Hey nginx, if you do not find a file (HTTP/404), please serve index.html instead (HTTP/200) and delegate routing to the client because it's a Javascript framework with its own client-side routing".
Adding the try_files with the current configuration was tested only with the new site frontend in mind and it worked well.

However, now we've learnt that other files must be served, then it means the current try_files setup need to be updated ton only keep this behavior on the frontend routes. And keep the older behavior on other routes.

I'm not sure to follow, can you explain what you mean by "the merge of files following the migration"?

That was a written shortcut to describe the PR you sent where you "merge" a file tree from the GH branch gh-pages into the public file tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants