aliyun LNMP包下的网站都有一个 conf文件,不像军哥的LNMP包,安好后使用的是默认的nginx.conf
aliyun LNMP默认网站安装的是PHPWIND程序,所以要使用wordpress必须修改一下在conf;
server {
listen 80; //在本地搭建多个网站时,其他网站可以使用别的端口,如8081,8082....,再复制修改一下conf文件即可。
server_name localhost;
index index.html index.htm index.php;
root /alidata/www/apple;
location ~ .*.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 1h;
}
#α¾²Ì¬¹æÔò
include /alidata/server/nginx/conf/rewrite/wordpress.conf; //这里原来是phpwind.conf
log_format fengxy '$remote_addr - $remote_user [$time_local] "$request" ' //原来是 log_format phpwind .....
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /alidata/log/nginx/access/phpwind.log phpwind; //这里的phpwind也可以换成网站名,方便以后查看log.
}

默认在/alidata/server/nginx/conf/rewrite 下有这些伪静态规则。

修改后记得测试和重启nginx.
/alidata/server/nginx/sbin/nginx -t

/alidata/server/nginx/sbin/nginx -s reload //重新加载nginx
最后
给阿里云打个小广告,因为如果你是备案域名的话,确实是非常不错的选择。
如果没有备案,或者像我一样不想备案就是另一回事了。。。
如果没有备案,或者像我一样不想备案就是另一回事了。。。
没有评论:
发表评论