Syncrify » Knowledge base

Document information

Document ID:5334
Subject:How to add custom headers in HTTP response
Creation date:1/2/20 11:15 AM
Last modified on:1/2/20 11:17 AM

Adding Custom Headers in HTTP Response

The method specified on this page applies to Syncrify and SynaMan

Companies often want to add custom headers in HTTP response to make the communication more secure.

There are two types of custom headers:

  • Hard-coded with a default value
  • User Defined

Hard-coded Headers

These headers are already present in the response but their presence can be overwritten by specifying a value in file. Following tables lists their name and default values:

Parameter in Header Name Header Value Strict-Transport-Security max-age=86400
use.x-frame.options x-frame-options SAMEORIGIN X-XSS-Protection 1; mode=block
use.x-content.type.options X-Content-Type-Options nosniff
use.referrer-policy Referrer-Policy no-referrer
use.http.public.key.pins Public-Key-Pins Dynamically generated

Changing Values for Default Headers

Assume you want to change the value for the Referrer-Policy from no-referrer to origin. Add the following lines in file.
Then, use the CustomHttpHeaders.txt file to specify the new value. (See below).

Adding User Defined Headers

  • Add a new text file called CustomHttpHeaders.txt in $INSTALL_DIR\config folder.
  • Every line in this file can hold a single pair of Header Name/Value. For example:
    Cache-Control: no-cache
  • Save the file
  • Restart Syncrify/SynaMan

Add a comment to this document

Do you have a helpful tip related to this document that you'd like to share with other users?

Important: This area is reserved for useful tips. Therefore, do not post any questions here. Instead, use our public forums to post questions.


Social Media

Powered by