phpmyadmin配置如下:
server {
listen 80 default;
server_name _;
index index.html index.htm index.php;
root /alidata/www/default;
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;
}
access_log /alidata/log/nginx/access/default.log;
}
注意:listen与server_name 也就是站点用ip访问方式。
web站点配置如下:
server {
listen 80;
server_name xxx.com www.xxx.com;
index index.html index.htm index.php;
root /alidata/www/xxx_com;
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/xxx.conf;
access_log /alidata/log/nginx/access/xxx.log;
}
注意root的站点路径
本文深入探讨了PHPMyAdmin配置及Web站点配置的关键设置,包括HTTP监听、站点名称、目录根路径、文件类型处理及访问日志等。

911

被折叠的 条评论
为什么被折叠?



