appnode不使用站点管理器,直接用nginx建站

配置

tp5环境原文

server {
    listen       80;
    server_name  logo.lxx123.club;
    # 注意根目录的权限,否之403
    root         /vhs/www/phpzcool/public/;
    index        index.html index.htm index.php;
	# 隐藏index.php
    location / {
        if (!-e $request_filename) {
            rewrite  ^(.*)$ /index.php?s=/$1 last;
            break;
        }
    }

    location ~ ^/.+\.php {
        fastcgi_index            index.php;
        fastcgi_split_path_info  ^(.+\.php)(/.*)$;
        fastcgi_param            SCRIPT_FILENAME $request_filename;
        fastcgi_param            PATH_INFO $fastcgi_path_info;
        fastcgi_param            PATH_TRANSLATED $document_root$fastcgi_path_info;
        include                  fastcgi_params;
        # 默认的fpm端口
        fastcgi_pass             127.0.0.1:9000;
    }
}

html原文

server {
    listen       80;
    server_name  love.lxx123.club;
    root         /vhs/www/lovetree;
    index        index.html index.htm;
}

一般php环境

server {
    listen       80;
    server_name  vps.lxx123.club;
    root         /vhs/www/dbninja;
    index        index.html index.htm index.php;

    location ~ ^/.+\.php {
        fastcgi_index            index.php;
        fastcgi_split_path_info  ^(.+\.php)(/.*)$;
        fastcgi_param            SCRIPT_FILENAME $request_filename;
        fastcgi_param            PATH_INFO $fastcgi_path_info;
        fastcgi_param            PATH_TRANSLATED $document_root$fastcgi_path_info;
        include                  fastcgi_params;
        fastcgi_pass             127.0.0.1:9000;
    }
}

猜你喜欢

转载自blog.csdn.net/HD2killers/article/details/83653895