I read and reread the nginx proxy_pass docs. I thought I understood it until I spent the last hour getting a nondescript error that doesn't make sense. Other people with the same problem don't seem related to this. Yesterday was my first day with nginx. I'm running nginx v1.12.2.
When someone requests https://example1.com/just-right/search I want to proxy that request to https://example2.com/abc.php
location ~ /just-right/search {
proxy_pass https://example2.com/abc.php;
}
Instead of proxying the path defined in proxy_pass I get the error:
"proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in line .......
I'm not using a regular expression. What does 'named location' mean? It's not inside of an if statement or "limit_except" block, so what did I do wrong?