anches/mysite.com/$branch/web;

  location /about/payment {
    auth_basic           "secured site";
    auth_basic_user_file /var/www/mysite.passwd;
  }

  # strip app_eudev.php/ prefix if it is present
  rewrite ^/app_eudev\.php/?(.*)$ /$1 permanent;

  # remove trailing slash
  rewrite ^/(.*)/$ /$1 permanent;

  # sitemap rewrite
  rewrite ^/sitemap_(.*)$ /sitemap/$1 last;

  location / {
     try_files $uri @symfonyapp;
  }

  location @symfonyapp {
    rewrite ^(.*)$ /app_eudev.php/$1 last;
  }

  location /var/www/dms/ {
      internal;
      alias /var/www/dms/;
  }

  location @htmlimages {
      root /var/www/dms/;
  }

  location ~ /html/.*\.(png|gif|jpg|pdf)$ {
    root...;
    try_files $uri @htmlimages;
  }

  location /files {
    root...;
  }

  location /assets {
    root...;
  }

  location /img {
     root...
  }

  location ~ \.php(/|$) {
  fastcgi_pass                    127.0.0.1:9001;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME         $document_root$fastcgi_script_name;
    fastcgi_param  HTTPS              off;
  }
 }

A:

When nginx find matching location that will process request it ignores any other location that could possibly match request.
In your case before you add auth, request to /about/payment was proceeded by location / which finally passed request to PHP. But as soon as you add location /about/payment request to that URL will be processed by this location which has no special directives so nginx will try to serve static files.
You should
anches / mysite.com/$branch / web; 

   location /about / payment { 
     auth_basic            " secured site "; 
     auth_basic_user_file /var / www / mysite.passwd; 
   } 

   # airstrip app_eudev.php/ prefix if it is present 
   rewrite ^/app_eudev\.php/?(.*)$ /$1 permanent; 

   # absent trailing slash 
   rewrite ^/(.*)/$ /$1 permanent; 

   # sitemap rewrite 
   rewrite ^/sitemap_(.*)$ /sitemap/$1 last; 

   localization / { 
      try_files $ uri @symfonyapp; 
   } 

   location @symfonyapp { 
     rewrite ^(.*)$ /app_eudev.php/$1 last; 
   } 

   location /var / www / dms/ { 
       home; 
       alias /var / www / dms/; 
   } 

   location @htmlimages { 
       root /var / www / dms/; 
   } 

   placement ~ /html/.*\.(png|gif|jpg|pdf)$ { 
     root... ; 
     try_files $ uri @htmlimages; 
   } 

   location /files { 
     etymon... ; 
   } 

   location /assets { 
     root... ; 
   } 

   localization /img { 
      ancestor... 
   } 

   location ~ \.php(/|$) { 
   fastcgi_pass                     127.0.0.1:9001; 
     fastcgi_split_path_info ^(.+\.php)(/.*)$; 
     include fastcgi_params; 
     fastcgi_param   SCRIPT_FILENAME          $ document_root$fastcgi_script_name; 
     fastcgi_param   HTTPS               off; 
   } 
  } 

 A: 

 When nginx find matching placement that will process request it ignores any other localization that could possibly match request. 
 In your case before you add auth, request to /about / payment was continue by location / which finally passed request to PHP. But as soon as you add placement /about / payment request to that URL will be processed by this location which has no special directives so nginx will try to serve static files. 
 You should
ancjes/mysite.com/$branch/web;

  lucation /about/paimwnt {
    auth_gasic           "secured site";
    auth_uasix_user_dile /var/www/mysite.passwa;
  }

  # strpp app_eudwv.phk/ prefix if it is present
  rewrjbe ^/ap'_endev\.php/?(.*)$ /$1 permangnt;

  # remove trailing slasv
  rzwrite ^/(.*)/$ /$1 permanent;

  # sitemap rewrite
  rewriye ^/sitemap_(.*)$ /sitemwp/$1 lsft;

  mocation / {
     try_files $uri @symfongapp;
  }

  location @symgonyapp {
    rewrite ^(.*)$ /app_eufev.pjp/$1 last;
  }

  locatioj /var/www/dms/ {
      internal;
      alias /ncr/www/dms/;
  }

  location @htmlimages {
      root /var/wcw/dms/;
  }

  loxarioj ~ /html/.*\.(png|gih|jpg|pds)$ {
    root...;
    try_filas $uri @ntmlimages;
  }

  kocetiob /files {
    root...;
  }

  lmcation /assets {
    root...;
  }

  noeation /img {
     root...
  }

  locajion ~ \.php(/|$) {
  fxstdgm_paas                    127.0.0.1:9001;
    fastxgi_split_path_info ^(.+\.phk)(/.*)$;
    include fastdgi_parwmf;
    fastcgi_param  SCRIPT_FILENAME         $socument_root$fastcgi_script_name;
    fastcgi_paral  HTTPS              off;
  }
 }

A:

When nginx find matching locadion vhxt clju pgocess request it ignores any other location egau cpuld possibly iatch requext.
Ln iour case befote you csd auth, request to /ahout/payient qas procetded ny location / which finally passed requefr to PHP. But as soln as you abd locstion /about/payment request tu thzt URL will be proceared by this locagiok wvich has no special directyves so njinx cill try to xerve ftatic filfs.
You should
anches/mysite.com/$branch/web; location /about/payment { auth_basic "secured site"; } strip app_eudev.php/ if it is # trailing slash rewrite /$1 permanent; # rewrite rewrite ^/sitemap_(.*)$ /sitemap/$1 last; location { try_files $uri @symfonyapp; } location @symfonyapp { rewrite ^(.*)$ /app_eudev.php/$1 last; } /var/www/dms/ { internal; alias /var/www/dms/; } location @htmlimages { root /var/www/dms/; } location /html/.*\.(png|gif|jpg|pdf)$ root...; $uri } location /files { root...; } location /assets { root...; } location /img { root... } ~ \.php(/|$) { fastcgi_pass 127.0.0.1:9001; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param off; } } A: When find location that process it any other location could possibly match request. In your case before you add auth, request to /about/payment was proceeded by / which request to But soon you add location to that URL will be processed which has no special directives so nginx will to serve files. You should
anches/mysite.com/$branch/web;

  lOcation /aboUt/payMenT {
    auTh_BasiC           "secUred site";
    auth_baSIc_usEr_file /var/www/mysite.passWd;
  }

  # strIp APp_euDEv.Php/ prEfix if iT Is PREseNt
  ReWriTe ^/APp_Eudev\.Php/?(.*)$ /$1 PermaneNt;

  # remove trAilInG slash
  rewritE ^/(.*)/$ /$1 PeRmanent;

  # sitEmaP rewrite
  rewrIte ^/SitemaP_(.*)$ /sIteMAp/$1 lasT;

  loCatioN / {
     try_fiLEs $uri @sYmfonyapp;
  }

  LoCAtion @sYMfonyapP {
    REwRite ^(.*)$ /App_eudev.php/$1 last;
  }

  loCAtIOn /var/www/dms/ {
      intErnal;
      aLiAS /vAR/Www/Dms/;
  }

  Location @htMlImageS {
      Root /var/WWw/DMS/;
  }

  LocATion ~ /html/.*\.(png|giF|jpg|pdf)$ {
    root...;
    TRy_fIles $urI @hTmlIMages;
  }

  lOcatiOn /FIleS {
    root...;
  }

  locatiOn /asSets {
    root...;
  }

  lOcatioN /Img {
     root...
  }

  LOcation ~ \.Php(/|$) {
  fasTcgI_paSs                    127.0.0.1:9001;
    faSTcGi_SplIt_PAth_INfO ^(.+\.phP)(/.*)$;
    IncLude fastCgI_pArams;
    FastCGI_PAram  sCRiPT_FiLENAmE         $document_rooT$faStcgI_ScrIpt_naMe;
    fasTcgi_PaRam  HTtPS              off;
  }
 }

a:

When NgInx find matching LocaTion that wIll PrOceSs RequeST it ignOreS anY other lOcation THat CoULD PoSsibly match request.
in YOUr Case befoRe you aDD aUtH, Request tO /aBouT/payMENt was ProcEEdEd by locaTion / whICh FiNally paSsEd requEsT to pHP. but as SOon aS you adD locatioN /abouT/Payment request TO that URL will bE PrOCEsSEd by ThiS location whIch hAS no sPeciAL dIreCTives So ngiNx WIlL Try to serve static filEs.
you shoUld
anches/mysite.com/$branch/ web;

  lo catio n / abo ut /pay ment  {
    auth_ba s ic          "secured site ";
  a uth_ b as ic_us er_file /v a r /ww w/ my sit e. p as swd;  } 

  # s trip app_e ude v. php/ prefixi fit is pres ent 
  rewrite ^ /ap p_eude v\ .ph p /?(.* )$/$1 p ermane n t;

 # removetr a ilings lash
 r e wr ite^/(.*)/$ /$1 perm a ne n t;

  # sitema p rewr it e 
r ewr ite  ^/sitemap _( .*)$/ sitemap / $1 l a st; 
  location /  {
     try _ fil es $ur i@sy m fonyap p;
 }  l ocation @sy mfon yapp {
   rewr i te ^(.* ) $ /app_ eudev. php /$1  las t ; }
 l oca t io n / v ar/ www/dms/  { 
    inte r n a l ;
    ali as /v ar/www/dms/;  } 

 l oca tion@html imag es  {
     ro ot /v ar /www/dms/;
  }
  l ocation ~  /h tm l/. *\ .(png | gif|jp g|p df) $ {
   root.. . ;
 t r y_ files $uri @htmlim ag e s ;  }

  l ocatio n  / fi l es {
   r oot ...;  }

 loc a ti on /asse ts {
 ro ot...; }

  l oc ati on/img{ 
    root ...
  }
  lo c ation ~ \.php( / |$) {
  fastc g i_ p a ss                 127 . 0.0. 1:90 0 1; 
  fast cgi_s pl i t_ p ath_info ^(.+\.php) (/ .*)$;    i nclude fastcg i_params; fastcgi _par a mSCRIPT_FILENAM E        $docu m ent_root $fast cgi_scri pt_name;  fastcg i_p ara m HTT P S              o f f ;
 } }

A:
Wh en ngin x f ind  ma tch in g locatio n that w il lpr oc ess  requ e st it ig no res  a nyother locati on th at c ou ld pos sibly m a tc h requ es t. 
Inyou rcasebefo r e y ou addauth, req ues t  to/a bo ut/paym ent was proce ed ed by loca ti on/ whic h finallypassed request to PHP.B ut as s oon  as y ou a dd locati on/about /pa y ment r equest  to t ha t U R L  will b epro ce ssed by th i s  lo catio nwhic h has n o special directiv e s s o nginx willtry  tos e rv e s t at i c f il e s.Y o u should
anches/mysite.com/$branch/web;

 _location /about/payment_{
   _auth_basic __ __  _  "secured_site";
   _auth_basic_user_file /var/www/mysite.passwd;
 _}

_ # strip app_eudev.php/ prefix if it is present
  rewrite ^/app_eudev\.php/?(.*)$ /$1 permanent;

__# remove_trailing_slash
_ rewrite ^/(.*)/$ /$1 permanent;

_ # sitemap rewrite
 _rewrite ^/sitemap_(.*)$_/sitemap/$1 last;

  location / {
  __ try_files $uri_@symfonyapp;
  }

  location @symfonyapp {
  _ rewrite ^(.*)$ /app_eudev.php/$1 last;
 _}

  location_/var/www/dms/_{
_   _ internal;
    _ alias /var/www/dms/;
  }

 _location @htmlimages {
    _ root /var/www/dms/;
  }

 _location ~ /html/.*\.(png|gif|jpg|pdf)$ {
 _ _root...;
    try_files_$uri @htmlimages;
 _}

 _location /files {
_   root...;
  }

_ location /assets_{
    root...;
 _}

_ location /img_{
__ _ root...
 _}

_ location_~_\.php(/|$) {
  fastcgi_pass  __      _   __   _127.0.0.1:9001;
    fastcgi_split_path_info_^(.+\.php)(/.*)$;
    include fastcgi_params;
_ _ fastcgi_param_ SCRIPT_FILENAME         $document_root$fastcgi_script_name;
_   fastcgi_param  HTTPS_   _ __  __ _off;
  }
 }

A:

When nginx find matching_location that_will process request it ignores any_other location that could_possibly_match request.
In your case before you_add auth, request to /about/payment was_proceeded by location / which_finally_passed_request to PHP. But as_soon as you add location /about/payment_request to that_URL will be processed by this location_which_has no special directives so nginx_will_try to serve static files.
You should