<div dir="ltr">Thanks peter,<div>In this case, both the new set of urls and old set of url are going to be exposed to different set of users. (And there are some DRM  related details I omitted in the email)</div><div>(similar to what  you are suggesting ) : One of the changes I am testing is simply copying the files/linking the files( which means serving tiles via nginx would be trivial , at the cost of increasing memory /  complications in the backend scripts that sync the data).</div><div><br></div><div>1) Computationally the mapping is not that hard, and the production server is has lot of CPU. So I am hoping that we can get away  with some sort of simple lua script.</div><div><br></div><div>2) Additionally it looks like a small percentage of the urls(both number and traffic wise) are served by lookup on a small redis db, and lua. So no major changes would be required in installation etc : as long as it scales decently...</div><div>HB</div><div>HB</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 23, 2019 at 7:39 PM Peter Booth via nginx <<a href="mailto:nginx@nginx.org">nginx@nginx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Here’s my opinion:<br>
<br>
You can do this however you want. It’s your website. Most of my work has been for other people. When I was working on my own startup it made me honest. Nothing was dynamic. The rationale  was â€œdo everything ahead of time so users never wait for anything and the site has 100% uptime”.<br>
<br>
So for your usecase - why make your users pay the price of your hashmap lookup? Why not publish/rewrite your content to the â€œright” site structure ahead of time? Sure, nginx with openresty / lua can be a super fast appserver. But boring solutions beat clever every time.<br>
<br>
My two cents,<br>
<br>
Peter<br>
<br>
Sent from my iPhone<br>
<br>
> On Mar 23, 2019, at 8:17 PM, Hemant Bist <<a href="mailto:hemantbist@gmail.com" target="_blank">hemantbist@gmail.com</a>> wrote:<br>
> <br>
> Hi,<br>
> 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. <br>
> <br>
> Currently our urls map directly to the local dir structure<br>
> e.g. the url /foo/10000/1234/9999/my.jpg is local file  /var/www/html/foo/10000/1234/9999/my.jpg so<br>
> <br>
> Now the url /foo/first/second/third/my.jpg will map to  /newfoo/new_first/new_second/new_third/my.jpg<br>
> where newfoo folder is done by lookup of a  static Hash_map/table of about 10000 to 20000 entries. <br>
> new_first (new_second and new_third) are calculated by some arithmatic operation on first(second and new  third).<br>
> <br>
> 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]<br>
> <br>
> Best,<br>
> HB<br>
> <br>
> <br>
> _______________________________________________<br>
> nginx mailing list<br>
> <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
> <a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></blockquote></div>