diff src/http/modules/ngx_http_proxy_module.c @ 1353:7443fbe0b013

named location
author Igor Sysoev <igor@sysoev.ru>
date Sun, 29 Jul 2007 18:11:39 +0000
parents 50b6cd5bc2e2
children 943f2ba615cd
line wrap: on
line diff
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -2276,13 +2276,17 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_
 
     plcf->upstream.location = clcf->name;
 
+    if (clcf->named
 #if (NGX_PCRE)
-
-    if (clcf->regex || clcf->noname) {
+        || clcf->regex
+#endif
+        || clcf->noname)
+    {
         if (plcf->upstream.uri.len) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                "\"proxy_pass\" may not have URI part in "
                                "location given by regular expression, "
+                               "or inside named location, "
                                "or inside the \"if\" statement, "
                                "or inside the \"limit_except\" block");
             return NGX_CONF_ERROR;
@@ -2291,8 +2295,6 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_
         plcf->upstream.location.len = 0;
     }
 
-#endif
-
     plcf->upstream.url = *url;
 
     if (clcf->name.data[clcf->name.len - 1] == '/') {