linux下nginx配置之phpmyadmin与web
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的站点路径
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了
