_isRedirect: is true for a location if it includes a return directive
_returnURLOrBody: URL to redirect to or a message to return to the client
_returnCode: specifies the code to return (100 - 599), is mandatory unless the URL/Body part starts with 'http://' or 'https://' when it is set to 302
"Invalid" return behaviour:
Even if the return location is "invalid", meaning that it isn't explicitly defined in the server config, it doesn't necessarily mean there will be an error. When Nginx receives a request for a location with a return directive in it, it will respond with that return. The client should then make a new request to the returned location. That request will be evaluated against the server config, and if there's no specific location block for the returned location, either the default location block will be used, or the 404 Not Found error will be returned.
NGINX: https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return
Relevant variables in location:
"Invalid" return behaviour: Even if the return location is "invalid", meaning that it isn't explicitly defined in the server config, it doesn't necessarily mean there will be an error. When Nginx receives a request for a location with a return directive in it, it will respond with that return. The client should then make a new request to the returned location. That request will be evaluated against the server config, and if there's no specific location block for the returned location, either the default location block will be used, or the 404 Not Found error will be returned.