jmau111
November 10, 2021, 10:14am
1
Hi,
[server]
[[server.headers]]
for = '/**.html'
[server.headers.values]
Permissions-Policy = "interest-cohort=()"
Strict-Transport-Security = "max-age=31536000; includeSubDomains"
X-Frame-Options = "SAMEORIGIN"
X-Content-Type-Options = "nosniff"
I can’t make the above config work on my local server. I’m obviously doing it wrong, but I don’t understand why. Can you help?
bep
November 10, 2021, 10:41am
2
jmau111:
Can you help?
At first glance (and this may look like a glitch in the documentation, too – I have updated it to be in line with how I think it works), it looks like it is currently hard to match only HTML files, see:
opened 10:36AM - 10 Nov 21 UTC
Bug
See https://discourse.gohugo.io/t/cant-make-the-local-server-use-headers/35519
…
```
REQ /docs/
REQ /favicon.ico
REQ /docs/
REQ /
REQ /fonts/muli-latin-200.woff2
REQ /fonts/muli-latin-400.woff2
REQ /fonts/muli-latin-800.woff2
REQ /output/css/app.css
REQ /output/js/app.js
REQ /images/hugo-logo-wide.svg
REQ /images/icon-fast.svg
REQ /images/icon-content-management.svg
REQ /images/icon-shortcodes.svg
REQ /images/icon-built-in-templates.svg
REQ /images/icon-multilingual2.svg
REQ /images/icon-custom-outputs.svg
REQ /images/sponsors/linode-logo_standard_light_medium.png
REQ /images/sponsors/esolia-logo.svg
REQ /images/sponsors/brave-logo.svg
REQ /images/homepage-screenshot-hugo-themes.jpg
REQ /images/home-page-templating-example.png
REQ /images/gopher-hero.svg
REQ /images/GitHub-Mark-64px.png
REQ /images/gopher-side_color.svg
REQ /favicon-32x32.png
REQ /fonts/muli-latin-700.woff2
REQ /fonts/muli-latin-400italic.woff2
REQ /manifest.json
REQ /android-chrome-144x144.png
```
These are currently matched by their RequestURI
, which does not contain any file suffix (unless you have uglyURLs turned on).
But for your use case, I suspect that if change it to for = '/**'
, you should be able to test what you wanted … or that is, I suspect, currently your best option.
1 Like
jmau111
November 10, 2021, 11:52am
3
bep:
/**
It’s perfect for my use case. Thanks for your help.
system
Closed
November 12, 2021, 11:53am
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.