nginx配置解析域名

server
{
        listen 80;
        server_name www.xxx.com;
        index index.html index.htm index.php;
        root /home/wwwroot/default/目录;


        location ~ .php{
            fastcgi_index  index.php;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_intercept_errors on;
            fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;
            fastcgi_split_path_info ^(.+.php)(.*)$;     #添加
            fastcgi_param PATH_INFO $fastcgi_path_info;    #添加
        }


        location / {
            if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
                break;
            }
        }

        if (!-e $request_filename) {
            rewrite ^(/index.php)?/(.*)$  /index.php/$2 break;
        }

        access_log  /home/wwwlogs/access.log;
    }

  

原文地址:https://www.cnblogs.com/bkhdd/p/15504810.html