nginx 414 Request-URI太长

时间:2014-07-10 03:08:56

标签: nginx request-uri

当我打开127.0.0.1时,网址会跳转到127.0.0.1/k.com/k.com/k.com/k/.com /......./ p>

我的主人

127.0.0.1 localhost
127.0.0.1 k.com

我的nginx配置

#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;
        }


    }
}

如何配置127.0.0.1,直接指向另一个目录或空白页面,或者直接指向localhost。

0 个答案:

没有答案