How to check the status code conditions and inheritance level when the security response header is added but not present in some responses?

📅 October 12, 2026 👁️ 13

Why is the security response header added, but not on some responses? Most cases are not due to non-effectiveness, but one of these two things: the status code of that response is not within the effective range of the header addition instruction, or the definition is written in another configuration level, and the upper group has not inherited. Troubleshooting should be based on the specific response missing the header to reproduce, rather than checking the normal page.

First confirm the type of response missing the header

The most common report is that the 'home page check is all green, but the error page is missing the header'. The reason is clearly written in the document: the header instruction is only added to the response when the response code is equal to 200, 201, 204, 206, 301, 302, 303, 304, 307, or 308. The returns in the four hundred and five hundred sections are not on this table, including common forbidden access, internal errors, and returns when static resources cannot be found. That is to say, the passing conclusion of the check tool on the normal page does not represent the abnormal path.

How to bypass the activation conditions

A solution is provided in the same document: add the always parameter, which will add this field regardless of the response code. This parameter has been provided since version 1.7.5. It is important to clarify the pros and cons - using always will add this set of headers to all returned data, including those generated by error pages or debugging entries. The benefit is complete coverage, but the cost is that if a header is incorrectly written, it will affect all responses. Security headers usually hope to take effect without exception, so this parameter is worth using in most scenarios.

Phenomenon Likely cause How to verify Common modifications
Present on normal pages, not on error pages Status code is not in the effective list Manually request a non-existent address to see the response Add always parameter
The upper level wrote, and all in a certain sub-block disappeared The same level defined the header command, and the upper group does not inherit Compare the position of the command in the configuration layer layer by layer Rewrite the group in the sub-block or use the inheritance parameter
All are local, and a part is missing online The response was rewritten by the front-end cache or compression layer Request with random parameters by bypassing the cache At the layer generating the response
Missing header in redirect response Only codes in the list are effective in the three hundred segments Requesting an old address known to redirect Change the redirect to internal rewrite or supplement on the target page

Inheritance hierarchy is the easiest to step on

This rule in the document is worth reading word by word: these instructions are inherited from the upper level only when no header instructions are defined at the current level. It is not a merge, but a replacement of the entire group.A typical accident is: A set of security headers is written in the main configuration of the site, and later, in order to add a header instruction related to caching in a sub-path block, a line of header addition instruction is written, resulting in the entire group above disappearing in this sub-path.When checking, don't just ask 'What has this sub-block written,' but ask 'Has this level written?'——as soon as it has been written once, the entire group above becomes invalid. The newer versions provide instructions to redefine inheritance rules, named add_header_inherit, appearing in version 1.29.3, which allows the lower level to append rather than replace on the basis of the upper level.

Locating which layer generated the position

Another source of missing response headers is: this response is not returned by the site program at all. Reverse proxy, caching layer, and load balancing can independently produce returns before the site, such as cache hits and error pages generated by proxy timeouts. The method to distinguish is to see if the response contains the fields that the program itself writes, and then directly request the site service port to reproduce it after bypassing the front-end layer. AnQiCMS listens on port 8001 by default, and is usually reverse proxied to it by the front-end server during deployment. Both sides have their own configuration layer response header settings, and comparing layer by layer is faster than a full restart to find the differences.

Review actions after going online

After the modification, it is recommended to take a response from each of the four paths: normal page, redirect address, non-existent address, and authentication entry. These four cover both types of status codes inside and outside the effective list, as well as the positions where the inheritance rules will be triggered. It is much more informative to record the header fields of each response and compare them, as opposed to running the score repeatedly on the checking site - the checking site usually only tests the homepage.

Common questions

Q: Can it be considered that the configuration is fine if only the homepage passes the check? A: No. The homepage has two hundred successful responses, which fall exactly into the effective list, and the performance of abnormal paths cannot be seen.

What is the reason why only writing one header in the child configuration will take away a group of headers? Answer: Because once a header addition instruction is defined at the same level, the upper level definition no longer inherits, and the replacement occurs for the entire group.

Why is the configuration still missing headers online after the change? Answer: First, confirm whether this response is directly returned by the cache or proxy layer, and the configuration of that layer needs to be supplemented separately.

Related articles

After splitting search and training into two switches, the access rules should be judged according to which purpose

On September 15, 2026, an edge platform announcement divided search, AI training, and AI agents into three independent controls, so the site does not have to choose between retaining search and blocking training. The announcement also provided two ratios: the mixed-purpose crawler accounted for 36.6% of the verified crawling traffic, less than 1% of the site side would block search crawlers, and about 17% restricted AI training. After the switches are opened, the access rules should be judged according to the purpose of access, not according to the source domain.

2026-10-12

There is a measurement that says the scraping scripts only follow a part of the exclusion rules, where is the difference in the ratio

A measurement covering thirty-six institutional sites, forty days of traffic, and about one hundred and thirty self-reported identity scraping scripts shows that the compliance rate varies greatly by instruction type: about 60.9% for scraping frequency instructions, about 31% for precise path prohibition, and about 30.7% for whole section prohibition; and less than four in ten scripts will re-read the exclusion file within one hundred and sixty-eight hours. These numbers indicate that relying solely on the exclusion file is not sufficient, and there must also be anti-crawling and permission layers within the site.

2026-10-12

When the Robots file itself is unreadable, what rules does the crawling party follow?

The original agreement divides the failure to read into two opposite results: when the response status code falls within the five hundred to five hundred and ninety-nine segment of server errors, the crawling party must consider it as completely prohibited; when it falls within the four hundred to four hundred and ninety-nine segment of client errors, the crawling party can access any resource on the server. The agreement also states that these rules are not access authorization and cannot replace content security measures; the background of the station and the user group permissions are the real door.

2026-10-12

Is the site description file for the large model meant for humans or for agents, the proposal has changed the statement.

This site description file, according to the current proposal, is to help agents use the website, while the early expression is to help the language model understand the web page, and the service object has expanded from the model to the agent. The file is a plain text list, and only one item is required in the specifications: a first-level title with a project or site name, the rest of the abstract sections, descriptive sections, and file lists grouped by secondary titles are optional. AnQiCMS supports automatic generation of site llms.txt and is different from the site map.

2026-10-12

The intermediate response code for pre-loading resources on the first screen, why is it only issued in multi-path multiplexing protocols in most cases?

The 103 intermediate response used for pre-loading resources on the first screen is a prompt issued by the server before it organizes the final page, allowing the client to pre-connect or pre-load resources. The official documentation suggests that for compatibility and security reasons, it should only be sent in HTTP protocol version 2 or higher, as most browsers only support it under these conditions. The reason is that under old protocols, the boundary handling between intermediate responses and final responses is inconsistent, which is easy to confuse with the content of waiting responses.

2026-10-12

In the front-end monitoring, the loading time of cross-domain images is all zero, which response header should be added

The loading time of cross-domain images is read as zero in the front-end monitoring, the missing is the timing pass response header. The official document defines: this header specifies which sources are allowed to see the attribute values obtained through the resource timing interface, otherwise these values will be reported as zero due to cross-domain restrictions. The value can be a wildcard to release all sources, or a comma-separated list of sources. It only affects timing readings and does not change the access permissions of the resources, so adding this header solves the attribution problem, not the access problem.

2026-10-12

What is the situation when the login credentials are partitioned by the top-level site when embedded by other sites?

Login credentials with partition attributes are stored separately by the top-level site: one is read when the same address is accessed directly, and another is read when the page is embedded by other sites, and they do not share. The official document states that this attribute indicates that credentials should be stored using partitioned storage, and it must be set at the same time as the security mark, and it is recommended to bind the credentials to the host with a hostname prefix name instead of a registrable domain. If the site assumes that the login state is globally shared, it will not be read in the embedded scenario.

2026-10-12

Why does the program overwrite the entire site configuration file when saving settings, and why does it overwrite the rules I added myself?

When saving settings, the program overwrites the directory-level configuration file, taking away the manually added rules along with it, because these files are only one copy, generated in full by the program according to its own template. The same program PbootCMS has fixed this issue in the update record of V3.2.26: When Apache turns on pseudo-static, it misjudges the environment, causing the configuration file under the site directory to be overwritten every time it is saved. The approach is to separate the rules managed by the program from the rules added by operations and maintain them in two places, backup before modification, and compare item by item after modification.

2026-10-12