nginx 配置 favicon.ico

nginx 配置 favicon.ico

配置文件

upstream nginx_server {

    server 10.130.100.17:80;

    server 10.130.100.18:80;

    server 10.130.100.19:80;

    server 10.130.100.20:80;

    server 10.130.100.21:80;

    server 10.130.100.22:80;

}

 

server {

    listen 80;

    server_name 202.108.177.43 202.108.177.44 find.nlc.gov.cn;

    index index.html index.htm index.jsp default.jsp;

 

    location ~ ^/favicon\.ico$ {

        root    /var/www/nginx-default;

    }

 

    location ^~ / {

        root    /var/www/nginx-default;

        proxy_set_header    Host    $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_next_upstream http_502 http_504 error timeout invalid_header;

        proxy_pass          http://nginx_server;

 

    }

 

}

把该favicon.ico放在/var/www/nginx-default下即可

 

猜你喜欢

转载自wuhenliushui.iteye.com/blog/2081812