Talk:Installation using Nginx

From Habari Project

Jump to: navigation, search

The example config should be updated to use try_files instead of the two conditionals, that's what it's for.

The expires block could be moved into a separate location declaration, though covering all static files that exist does have some merit.

The running config on habariproject.org:

	# disable logging for popular static files
	location = /favicon.ico {
		log_not_found off;
		access_log off;
	}

	location = /robots.txt {
		log_not_found off;
		access_log off;
	}

	location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
		expires max;
		log_not_found off;
	}

	location /en/ {

		# force ssl for login and admin pages
		rewrite ^/en/(admin|auth)(.*) https://$host$request_uri;

		try_files $uri $uri/ /en/index.php?$args;

		if ( -f $request_filename ) {
			expires 30d;
			break;
		}

	}
Personal tools