PHP development framework kohana3.3.1 pseudo static setup example under nginx

  • 2020-05-10 23:15:37
  • OfStack

Kohana is a pure PHP5 framework based on MVC mode. It features high security, lightweight code, ease of use, and the latest kohana3 supports HMVC mode. Here is a pseudo-static configuration reference example for kohana in the nginx environment:


server
	{
		listen    80;
		server_name 55zaza;
		index index.html index.htm index.php default.html default.htm default.php;
		root /home/wwwroot/55zaza;

		#include kohana_rw.conf;

		location / {
			index index.php;
			try_files $uri $uri/ /index.php?$uri&$args;
		}

		location ~ .*\.(php|php5)?$
			{
				try_files $uri =404;
				fastcgi_pass unix:/tmp/php-cgi.sock;
				fastcgi_index index.php;
				include fcgi.conf;
			}

		location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
			{
				expires   30d;
			}

		location ~ .*\.(js|css)?$
			{
				expires   12h;
			}
		access_log off;
	}


Related articles: