|CUSTOM1|
|?WWW_PREFIX=www.|
|*if WWW_REDIRECT="no"|
|?WWW_PREFIX=|
|*endif|
|CUSTOM2|
server
{
		|CUSTOM3|
        listen |IP|:|PORT_80|;
        |MULTI_IP|
        server_name |POINTER| www.|POINTER|;
        rewrite     ^ http://|WWW_PREFIX||DOMAIN|$request_uri? permanent;
		|CUSTOM4|
}

|*if HAVE_SSL="1"|
server
{
	|CUSTOM5|
	listen |IP|:|PORT_443| ssl|SPACE_HTTP2|;
	|MULTI_IP_SSL|
	server_name |POINTER| www.|POINTER|;
	rewrite     ^ https://|WWW_PREFIX||DOMAIN|$request_uri? permanent;

	ssl_certificate      |CERT|;
	ssl_certificate_key  |KEY|;
	|CUSTOM6|
}
|*endif|
|CUSTOM7|