I am moving my old Url's to the new one (it is more than 50) so I have placed the URLs in a file but the redirection is not happening.
map_hash_max_size 262144;
map_hash_bucket_size 262144;
map $uri $new {
include /etc/nginx/maps/redirect_example_com.map;
}
if ($new) {
rewrite ^ $new redirect;
}
and below URL is in the file redirect_example_com.map
/wp/articles /aricles;
The same configuration is using in another virtual host which is working fine.
#map_hash_max_size 262144;
#map_hash_bucket_size 262144;
map $uri $new {
include /etc/nginx/maps/redirect_hello_com.map;
}
if ($new) {
rewrite ^ $new redirect;
}
Here I am not using the bucket size.
$new
variable in both configurations?($new)
variable and edited the question. hello.com is working fine but example.com is not working.not working
? What is the error you experience? You have a typo in your .map file (aricles
->articles
), if that's not a typo in this question only it will most probably an issue.nginx
? Themap
directive is in thehttp
block and would need to use unique variable names, e.g.$new1
and$new2
.nginx: [emerg] could not build map_hash, you should increase map_hash_bucket_size: 64
,