linux下nginx配置之phpmyadmin与web

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/whosheng/article/details/50866972

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

猜你喜欢

转载自blog.csdn.net/whosheng/article/details/50866972