memo.xight.org

日々のメモ

mahara を nginx + mysql で動作させる

Summary

Mahara を nginx + mysqlで動作させるための設定。

/etc/nginx/sites-available/mahara

server {
	listen   80 default;
	server_name  example.com;
	root   /var/www/example.com;
	index index.php;
	server_tokens off;

	access_log  /var/log/nginx/example.com.access.log;

	location / {
		try_files $uri $uri/;
		expires 3d;

		gzip  on;
		gzip_disable "MSIE [1-6]\.(?!.*SV1)";
		gzip_types text/css application/x-javascript;
	}

	location ~ \.php$ {
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_intercept_errors on;
		fastcgi_pass 127.0.0.1:9000;
	}

	location ~ /\.ht {
		deny  all;
	}
}

server {
	server_name www.example.com;
	rewrite ^ $scheme://example.com$request_uri? permanent;
}

Reference

System Administrator's Guide/Installing Mahara/Mahara on fastcgi//nginx
http://wiki.mahara.org/index.php/System_Administrator's_Guide/Installing_Mahara/Mahara_on_fastcgi//nginx