apache rewrite to nginx

frank3427 nginx-forum at forum.nginx.org
Wed Jun 14 18:04:34 UTC 2017


so far I have come up with the following but , I have been reading that
using if statements is bad.
if ($http_host ~ "^rwa-(.*)"){
set $rule_0 1;
set $bref_2 $2;
set $bref_7 $7;
}
if ($http_host ~ "^m2m-(.*)"){
set $rule_0 1;
set $bref_2 $2;
set $bref_7 $7;
}
if ($http_host ~ "^dwa-(.*)"){
set $rule_0 1;
set $bref_2 $2;
set $bref_7 $7;
}
if ($rule_0 = "1"){
rewrite ^/(/ws/v[1-9]/dias/[^+]*)\+([^+]*)$
https://${host_finder:$http_host}/$1\$bref_2B$2https://$$bref_7bhost_finder:$bref_25$bref_7bHTTP_HOST$bref_7d$bref_7d/$1/$bref_2B$2
last;
}
if ($http_host ~ "^rwa-(.*)"){
set $rule_1 1;
set $bref_2 $2;
}
if ($http_host ~ "^m2m-(.*)"){
set $rule_1 1;
set $bref_2 $2;
}
if ($http_host ~ "^dwa-(.*)"){
set $rule_1 1;
set $bref_2 $2;
}
if ($rule_1 = "1"){
rewrite ^/(/ws/v[1-9]/dias/.*)\+(.*)$ /$1\$bref_2B$2;
}
if ($http_host ~ "^rwa-(.*)"){
set $rule_2 1;

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,274815,274871#msg-274871



More information about the nginx mailing list