I'm trying to get these 2 location directives working in Nginx but I'm getting some errors back when booting Nginx. location ~ ^/smx/(test|production) { proxy_pass http://localhost:8181/cxf; } location ~ ^/es/(test|production) { proxy_pass http://localhost:9200/; } This is the error I'm receiving: nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside n