Hi @mdodge,
For rule patterns:
In the URL rewriting module of IIS, only when the URL of the rule pattern matches successfully, other rules can play a role. The matching URL setting of the rule pattern is mainly to match the path part in the URL. Assuming that the URL address of the current website is https://example.domain.local/api/test, the matching part of the rule pattern is api/test.
So I think <match url="^https://example.domain.local/api/(.*)" />
should be changed to <match url="^api/(.*)" />
For rule evaluation order:
Each configuration level in IIS can have zero or more rewrite rules defined. The rules are evaluated in the same order in which they are specified. The URL Rewrite Module processes the set of rules by using the following algorithm:
- First, the URL is matched against the pattern of a rule. If it does not match, the URL Rewrite Module immediately stops processing that rule, and goes on to the next rule.
- If a pattern matches and there are no conditions for the rule, the URL Rewrite Module performs the action specified for this rule and then goes on to the next rule, where it uses the substituted URL as an input for that rule.
- If a pattern matches and there are conditions for the rule, the URL Rewrite Module evaluates the conditions. If the evaluation is successful, the specified rule action is performed, and then the rewritten URL is used as input to the subsequent rule
A rule may have the StopProcessing flag turned on. When the rule action is performed (i.e. the rule matched) and this flag is turned on, it means that no more subsequent rules will be processed and the request will be passed to the IIS request pipeline. By default, this flag is turned off.
I see that stopProcessing="true" is set in your React Routes rule, so this causes subsequent rules not to be processed after that React rule is processed, what you need to do is change this setting to stopProcessing="false" (That is, uncheck the Stop processing of subsequent rules in the IIS rewrite module).
You can learn more from this official Microsoft document: URL Rewrite Module Configuration Reference
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.
Best regards,
Yurong Dai