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

Transparently redirect wikipedia URLs to the corresponding wikipedia for schools URL, if present #33

Open
usernamenumber opened this issue Jan 25, 2015 · 7 comments

Comments

@usernamenumber
Copy link
Contributor

The wikipedia role is written for Apache, but the current system uses nginx. Role needs to be "ported" to deploy to nginx instead.

@devalih
Copy link
Contributor

devalih commented Feb 2, 2015

Nginx community has a good template to start with
http://wiki.nginx.org/MediaWiki

@Ar2000jp
Copy link
Contributor

Ar2000jp commented Feb 3, 2015

@devalih That link is for MediaWiki, not WfS.
WfS seems to be static only. The apache config uses RewriteRule & CheckSpelling to translate from Wikipedia URLs to WfS. This is useful for making use of Wikipedia's search engine, I think.
From my research, NGINX doesn't have an equivalent for the spelling module. 2 alternatives come to mind:
1- Serve WfS static, without Wikipedia -> WfS redirection.
2- Write some CGI to handle the spelling rewrite.

@usernamenumber
Copy link
Contributor Author

Hi guys, just checking in real quick from a WiFi cafe (probably my only
time online until Sunday). IIRC, mod_speling is only used for case issues,
like making '/Chemistry' match '/chemistry' (or maybe it's the other way
around?). There's probably a way to use a case-insensitive regex in nginx
that just writes both to the correct values. I'd suggest researching that.

And Ahmad, it was great to check my email and see so much activity from
you! I look forward to revising as much of it as I can before I have to
leave the cafe. Great work!
On Feb 3, 2015 5:04 AM, "Ahmad Draidi" [email protected] wrote:

@devalih https://github.com/devalih That link is for MediaWiki, not WfS.
WfS seems to be static only. The apache config uses RewriteRule &
CheckSpelling to translate from Wikipedia URLs to WfS. This is useful for
making use of Wikipedia's search engine, I think.
From my research, NGINX doesn't have an equivalent for the spelling
module. 2 alternatives come to mind:
1- Serve WfS static, without Wikipedia -> WfS redirection.
2- Write some CGI to handle the spelling rewrite.


Reply to this email directly or view it on GitHub
#33 (comment).

@Ar2000jp
Copy link
Contributor

Ar2000jp commented Feb 4, 2015

RegEx is used for matching only, AFAIK. It can't be used to change the matched variables.
The problem is getting the URI to match the files on disk. After some research, there seems to be no way for NGINX to load files in a case-insensitive way, except for external modules.
I found this: https://github.com/replay/ngx_http_lower_upper_case , but I think it's a bad idea to use an external module. A small CGI script would be easier to maintain.

PS: Thank you. :)

@usernamenumber
Copy link
Contributor Author

This is at least fixed for now by integration of the RACHEL module for Wikipedia for Schools. However, eventually we want some automation that translates wikipedia URLs into the corresponding WfS URL.

For now, though, the minimum we need is sorted out once #48 is resolved and RACHEL support can be merged in.

@usernamenumber usernamenumber changed the title Rewrite wikipedia role for nginx instead of apache Transparently redirect wikipedia URLs to the corresponding wikipedia for schools URL, if present May 7, 2015
@usernamenumber usernamenumber removed this from the Initial test deployment milestone May 7, 2015
@usernamenumber
Copy link
Contributor Author

Updated the title to reflect the current goal of this issue. Removed from the initial release milestone.

@usernamenumber
Copy link
Contributor Author

Relevant comment about kili.io's configuration, which does something like what we want: #20 (comment)

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

No branches or pull requests

3 participants