牛骨文教育服务平台(让学习变的简单)
博文笔记

linux下nginx配置之phpmyadmin与web

创建时间:2016-03-12 投稿人: 浏览次数:1064

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的站点路径

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。