先于域名服务器进行解析
然后在nginx服务器中设置 域名.conf
thinkphp
server
{
listen 80;
#listen [::]:80;
server_name **.com ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/**.com/public;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include proxy-pass-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
设置好后重启服务器 nginx -s reload