3 ms·
You can specify HTTP headers for a path/location in nginx in a static website and have it include arbitrary headers. Most standards respecting browsers (like Fi
by superkuh 4y ago
You can specify HTTP headers for a path/location in nginx in a static website and have it include arbitrary headers. Most standards respecting browsers (like Firefox) accept HTTP header specified CSS like,
#/etc/nginx/sites-enabled/whatever.conf
location /this-isnt-for-you.html {
add_header Link "<//site.com/isntforyouheader.css>; REL=stylesheet";
}
$ curl -I http://site.com/this-isnt-for-you.html
curl -I site.com
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 28 Nov 2022 18:08:01 GMT
Content-Type: text/html
Connection: keep-alive
Link: <//site.com/isntforyouheader.css>; REL=stylesheet
...
This works to set CSS atributes only for a specific URL on my static websites using .html files. For nginx. But nginx is a very common and secure choice for static sites and available in everyone's repos. And you can probably add arbitrary headers per path with other static webservers configs too.