mozilla / payments-env

Environment for running payments. See https://payments.readthedocs.org
Other
9 stars 10 forks source link

Add accept-language rewriting to nginx #43

Open muffinresearch opened 9 years ago

muffinresearch commented 9 years ago

To be able to serve a localized version of payments-ui we need to add something to nginx to handle redirects based on accept-language headers.

See http://stackoverflow.com/questions/3657614/how-to-rewrite-location-in-nginx-depending-on-the-client-browsers-language

The benefit with the static route is it should be possible for someone to visit localized static content from the payments-ui tree and see it as it should be. Not to mention if running via pay.dev it should work with accept-language directly.

This looks like it might be worth a try https://github.com/fghibellini/nginx-http-accept-lang/blob/master/lang.lua

If doing it this way is a concern then we should probably look at some other solution e.g. some minimal additional service fronting the SPA.

andymckay-limited-access commented 9 years ago

I got this working: https://github.com/mozilla/payments-env/pull/44

But I don't want merge this until I know where the files are going. But just fiddling around the files should be pretty straightforward. Will update when mozilla/payments-ui#215 is done.