-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add Nginx magic for Dashboard access #3518
Add Nginx magic for Dashboard access #3518
Conversation
Add a location/rewrite directive to rewrite URIs which begin with /dashboard which aren't lower case or which lack the trailing slash, mapping them to lower case and adding the slash.
rewrite ^ /dashboard/ permanent; | ||
} | ||
|
||
location ^~ /dashboard/ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what exactly does the addition of the ^~
accomplish vs the old form? I assume this means "begin-anchored pattern match", but as the "pattern" is a fixed text string, what does this add? And when we just load /dashboard/
, are we loading $uri/index.html
(line 143's try_files
), which is /dashboard//index.html
, or are we loading the /dashboard/index.html
literal fallback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what exactly does the addition of the ^~ accomplish vs the old form?
Per the docs,
If the longest matching prefix location has the
^~
modifier then regular expressions are not checked.
So, this prevents recursive rewrites: after the rewrite, the location
at line 139 matches and disables further match-searching, so the regex match is not reevaluated. (This was critical in the previous iteration of this code; however, now that I've got the no-trailing-slash location anchored at both ends, we could get by without this, but having it makes the search more efficient.)
when we just load
/dashboard/
, are we loading$uri/index.html
(line 143'stry_files
), which is/dashboard//index.html
, or are we loading the/dashboard/index.html
literal fallback?
I expect that we try to load /dashboard/
which fails because it's a directory; then we probably try to load /dashboard//index.html
which probably succeeds (Nginx may squash out the extra slash, and, if not, then open()
call probably ignores it); and, if that fails, we load the fallback, /dashboard/index.html
.
pquisby 0.0.13 is now up on PyPi, and it's broken:
|
@dbutenhof Hi, Could you share the details of the project for me to debug? I haven't been aware of the development so far. This looks like a simple import issue. Let me know. |
Hi @sourabhtk37, We install the I wasn't able to find the details of the Thanks! |
@sourabhtk37 @siddardh-ra @vishalvvr @MVarshini Is there any update on a fix for Thanks! |
@sourabhtk37 @siddardh-ra @vishalvvr @MVarshini I see that a Is there any update on fixing this problem? |
Worked around the build problem for the moment via #3520. |
Currently, attempts to load the Pbench Dashboard (e.g., from the Staging server) via requests like
or
will each fail (with a
404
and a blank page, respectively).To improve the user experience, this PR adds a
location
directive which rewrites the URI, down-casing the "dashboard" and adding the trailing slash if it is missing. This returns a301
/Moved Permanently
response to the browser which causes it to retry at the correct location (which then gets routed properly).This change also changes the existing Dashboard
location
to require the trailing slash and makes the match preferred over the regex matches, to avoid recursive rewrites.(BTW, this change has already been deployed on the current Staging Pbench Server instance, if you want to kick the tires.)