Nginx configuration CI support framework and prohibit the use ip access

#CI
server {
        listen      80;
        server_name www.ci.com;
        index       index.php index.html index.htm;
        root        "/servers/apps/CI";
      location ~ \\.php{
       fastcgi_pass 127.0.0.1:9000;
           fastcgi_index index.php;
            ##########################################pathinfo 模式
            set $path_info "";
            set $real_script_name $fastcgi_script_name;
            if ($fastcgi_script_name ~ "^(.+?\\.php)(/.+)$"){
                 set $real_script_name $1;
                 set $path_info $2;
            }
            include fastcgi.conf;
            fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
            ##########################################nginx支持pathinfo 模式的重点    

       }      
}

 

Join nginx.conf

# Prohibit access to IP
Server
{
  the listen 80 default;
  server_name _;
  return 500;
}

http added to the server

http
{
 server{}
}

Reproduced in: https: //www.cnblogs.com/caly/p/3372509.html

Guess you like

Origin blog.csdn.net/weixin_34150830/article/details/93538123