Hi Jim,
Thank you very much!
In LOCATION statement I forgot the equal operator "="
location = /catalog/category1 {
return 301 /catalog/newcategory1;
}
In this way redirect only the exact match with (https://www.mydomain.com/catalog/category1 ) and the other sub urls remains the same.
Before
https://www.mydomain.com/catalog/category1
https://www.mydomain.com/catalog/category1/product1
https://www.mydomain.com/catalog/category1/product2
https://www.mydomain.com/catalog/category1/product3
After
https://www.mydomain.com/catalog/newcategory1
https://www.mydomain.com/catalog/category1/product1
https://www.mydomain.com/catalog/category1/product2
https://www.mydomain.com/catalog/category1/product3