ngix的一些常用配置

发布时间 2023-08-04 16:27:58作者: 东方春

#重定向

如果域名为www.XXX.com/或者www.XXX.com则重定向到 www.XXX.com/frontpage/index.html
注意(1)uri是指域名(www.XXX.com)后面的东西。
       (2)nginx的逻辑代码必须都要有空格
        (3)rewrite 函数第一参数怎么个用法,目前没搞清楚。
        location / {
            if ( $request_uri = "/") {                                  
                rewrite /   frontpage/index.html redirect;
            }
            root   ./html;
            index  index.html index.htm;
        }