-1

I have following lighttpd redirect rules and would need to convert them to nginx:

url.rewrite-once = (

   "^/misc(.*)" => "/misc$1",
   "^/show_fileupload.php(.*)" => "/show_fileupload.php$1",
   "^/flash(.*)" => "/flash$1",
   "^/images(.*)" => "/images$1",
   "^/css(.*)" => "/css$1",
   "^/js(.*)" => "/js$1",
   "^/filestore(.*)" => "/filestore$1",
   "/(([a-f0-9]{32})/)?(app/(.+?)/)(lang/(\w{2}-\w{2}|\w{2}|)/)?/*([^\?]*)(?:\?(.*))?" => "/$4.php?rs_module_uri=$7&rs_session=$2&rs_app=$4&rs_lang=$6&$8",
   "/(([a-f0-9]{32})/)?(app//)?(lang/(\w{2}-\w{2}|\w{2}|)/)?/*([^\?]*)(?:\?(.*))?" => "/main.php?rs_module_uri=$6&rs_session=$2&&rs_lang=$5&$7",

)

How to convert especially the last two lines?

KiwiJuicer
  • 1,952
  • 14
  • 28

1 Answers1

0

I finally got it to work, it's even not that different:

rewrite "/(([a-f0-9]{32})/)?(app/(.+?)/)(lang/(\w{2}-\w{2}|\w{2}|)/)?/*([^\?]*)(?:\?(.*))?" /$4.php?rs_module_uri=$7&rs_session=$2&rs_app=$4&rs_lang=$6&$8 last;
rewrite "/(([a-f0-9]{32})/)?(app//)?(lang/(\w{2}-\w{2}|\w{2}|)/)?/*([^\?]*)(?:\?(.*))?" /main.php?rs_module_uri=$6&rs_session=$2&&rs_lang=$5&$7 last;
KiwiJuicer
  • 1,952
  • 14
  • 28