Adding "Link" Header

António P. P. Almeida appa at
Thu Feb 9 23:27:30 UTC 2012

On 9 Fev 2012 22h43 WET, nginx-forum at wrote:

> To avoid SEO issues on my subdomains, I need to add a "Link" header
> to support Google's canonical header.  The format is as follows
> (from
> Link: <>; rel="canonical"
> So, the add_header command would need to reference $uri, but it also
> needs a semi-colon and double quotes.  How can I add this header to
> my config?

add_header Link "<$scheme://$http_host$request_uri>; rel=\"canonical\""; 

--- appa

More information about the nginx mailing list