Nginx 之虛擬主機配置

server {
        listen       8080;
        server_name  www.chat.com chat.net;
        root   "G:/phpstudy/nginx/html/chat";
        
        access_log  logs/www.chat.com.access.log;
        error_log  logs/www.chat.com.error.log debug;
        
        location / {
            index  index.html index.htm index.php client.html;
            autoindex  off;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            
            fastcgi_connect_timeout 60;
            fastcgi_read_timeout 60;
            fastcgi_send_timeout 60;
            
            include        fastcgi_params;
        }
}

相關文章
相關標籤/搜索