-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix regular expressions in nginx config #1152
Conversation
A number of fixes to regular expressions in the nginx config example: * escaping forward slash by prefixing a backslash (not essential, but seems good practise anyway) * fix the second expression in fastcgi_split_path_info to allow for uris ending in .php (which do satisfy the location definition but would result in a 404 with the current specification of fastcgi_split_path_info * adding /nextcloud to all regex location definitions in the subdirectory example
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.
Yes!
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.
🙈
/backport to stable15 |
/backport to stable14 |
/backport to stable13 |
backport to stable15 in #1158 |
The backport to stable13 failed. Please do this backport manually. |
backport to stable14 in #1159 |
@jknockaert I was not notified about this PR and had I had some questions/comments on the changes.
Why is your change good practice? Forward slash "/" is not a special character in Nginx regex. In my opinion this change just makes the config harder to read.
How could a 404 can ever be encountered with the original config? If a client requests for example index.php, the original configuration of
Why is this necessary? The two locations you added this to are already nested under |
@josh4trunks Sorry for not notifiying you. |
@jknockaert Not your fault I wasn't notified =]. I usually am mentioned for all NGINX changes but this one must have slipped by. The only reason regex101.com wants Why is it preferable to match Hidden files (like ".html") would never be processed by the two regex locations being discussed. They would have already matched the below location since it resides earlier in the config
|
If I remember well, for the |
I am confused by your Changing or reordering regex locations does break things. This has always been the case, and I do not see how adding |
@jknockaert I never received a response to my previous question. By my perspective (see #1152 (comment)) the 3 changes here make no difference in any of NGINX's interpretation of the example configurations, and only add complexity for admins reading them. I am open to further discussion, but otherwise plan on submitting a PR reverting these changes. |
A number of fixes to regular expressions in the nginx config example: