feat: Add new routes in nginx config of stats.jenkins.io#7621
feat: Add new routes in nginx config of stats.jenkins.io#7621Vatsal-Verma wants to merge 4 commits into
Conversation
|
While we are reviewing this in the upcoming days, could you describe how did you test this proposal change to ensure it works as expected (nominal cases)? |
|
After reading your issue (thanks for the many details in the issue! It helps), this PR won't solve the issue alas. The key is the location Given the SPA routes does not change often in this application (we have 4 and it is not expected to change), adding the 4 routes is a good trade-off (because we have to maintain this list of 4 endpoints in both the SPA code and the Nginx application). But we'll have to decide how to handle the root URI: I guess we shall capture the exact location But we have to see if we shouldn't keep the normal |
|
So, should we remove try_files from location = / ? |
Are you ok to reproduce by running the helm-chart into a local (Sorry been busy today to work on reproducing to help you) |
I can definitely do the second thing i.e. "Or maybe by using the btw earlier I was testing for this configs for routes before I found the main configs for which the project is defined. this was based on the fact "Serve index.html. if it doesn't exist, return 404" |
|
That's good, thanks for your tests. It helps! FTR, the content from "old.stats.jenkins.io" is retrieved by https://github.com/jenkins-infra/stats.jenkins.io/blob/main/retrieve-infra-statistics-data.sh when building the stats.jenkins.io in https://github.com/jenkins-infra/stats.jenkins.io/blob/a55d61a2daea1c911913df48a01a0a28e94d98b2/Jenkinsfile#L46-L50. It happens before building the SPA: any collision in the It means you can increase your tests: if you use the shell script above, you can do the same on your local nginx. Would be useful to test the "merged" dist dir and reproduce the whole production setup. |
Thanks, I completely forgot to run that sh command (it takes a lot of time to retrieve the data when i tried it last time tbh 😅). I agree, That dist would much be better to test. |
You may directly retrieve the |
|
I would like to put something forward. I've noticed that the routes on my local nginx are throwing 404 if even they exist. So, here is the problem (Currently this is working on the production level dist SPA + old data). What this block is doing. It will check nginx/html if there is a file with this name or a dir? if no then it will give 404 and in our case there is nothing like so in the dir. There is indeed the previous/old data which has dir becuase of which it's working fine for those previous routes. So, I want to say is that, it will give 404 for every case. So, I propose to make the use of So, what it does is that, it serves index.html. if it doesn't exist, return 404 without try_files (on new routes)
With try_files (on new routes)
Screenshot (web with try_files on each new route)
|
|
Hello @Vatsal-Verma , a quick head up to let you know that we'll look at it (we don't forget you!) but expect some delays as some team member are in vacations |
|
Sorry, we've been busy and did not had enough time. We'll try our best in the upcoming days |











stats.jenkins.io is a SPA becuase of which it shows 200 OK status on the pages that don't exist or are invlid. So, I found this ngnix config where we can define strict routing.
Currently, the routes present are of old.stats.jenkins.io, However new routes such as:
are not yet added.
Question from maintainers
fixes jenkins-infra/stats.jenkins.io#671