title: nginx 414 Request-URI Too Long
body: <p>when I open 127.0.0.1, the url would jump to 127.0.0.1/k.com/k.com/k/.com/......</p>
  
  <p>my hosts</p>
  
  <pre><code>127.0.0.1 localhost
  127.0.0.1 k.com
  </code></pre>
  
  <p>my nginx config</p>
  
  <pre><code>#user  _www;
  worker_processes  1;
  #pid        logs/nginx.pid;
  events {
      worker_connections  1024;
  }
  
  http {
      access_log off;
      gzip off;
      gzip_min_length 1k;
      gzip_buffers 4 16k;
      gzip_http_version 1.1;
      gzip_comp_level 2;
      gzip_types text/plain application/json application/x-javascript text/css application/xml text/javascript;
      gzip_vary on;
      gzip_disable "MSIE [1-6]\.";
      include       mime.types;
      default_type  application/octet-stream;
      sendfile        on;
      keepalive_timeout  65;
  
  
  
      server {
          listen       80;
          server_name  k.com;
  
          client_max_body_size 20M;
  
          root         F:/xxxx/www; 
          underscores_in_headers on;
          index        index.html;
  
  
          add_header 'Access-Control-Allow-Origin' '*';
          add_header 'Access-Control-Allow-Credentials' 'true';
          add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE';
          add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,username,password,remember,token';         
  
  
          location / {
              try_files $uri $uri/ /index.html;
          }
  
          location = /index.html {
              add_header Cache-Control no-cache;
              add_header Cache-Control private;
          }
  
  
  
      }
  
      server {
          listen       80;
          server_name  localhost;
          root         F:/xxxx/www/htdocs; #
          index        index.html index.php;
          autoindex    on;
  
          location / {
              try_files $uri $uri/ /index.html;
          }
  
  
      }
  }
  </code></pre>
  
  <p>how to configure 127.0.0.1 , direct to another directory or empty page, either or direct to localhost.</p>