Welcome! Log In Create A New Profile

Advanced

Mapping url to physical urls using lua script or something else.

Hemant Bist
March 23, 2019 08:20PM
Hi,
I want to know if this a right way to make the change ( or if there is a
better /recommended method). So far we have only tweaked the configuration
of nginx which scales very nicely for us The change I need to do looks
like a common case to me.

Currently our urls map directly to the local dir structure
e.g. the url /foo/10000/1234/9999/my.jpg is local file
/var/www/html/foo/10000/1234/9999/my.jpg so

Now the url /foo/first/second/third/my.jpg will map to
/newfoo/new_first/new_second/new_third/my.jpg
where newfoo folder is done by lookup of a static Hash_map/table of about
10000 to 20000 entries.
new_first (new_second and new_third) are calculated by some arithmatic
operation on first(second and new third).

My plan is: a) pass all handling to a lua script that will do
internal_redirect to the correct physical url... And do a load test to make
sure that is not too much performance hit. [ I haven't implemented it, but
it looks possible from the examples I have looked at so far]

Best,
HB
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Mapping url to physical urls using lua script or something else.

Hemant Bist March 23, 2019 08:20PM

Re: Mapping url to physical urls using lua script or something else.

Peter Booth via nginx March 23, 2019 10:40PM

Re: Mapping url to physical urls using lua script or something else.

Hemant Bist March 25, 2019 12:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 282
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready