Answers for "get hostname without subdomain in nginx config"

0

get hostname without subdomain in nginx config

# copy as it is do not replace domain with your domain name
server {
	if ($host ~ ^www\.(?<domain>.+)$) {
		return  301 $scheme://$domain$request_uri;
	}
}
Posted by: Guest on May-18-2021

Browse Popular Code Answers by Language