Additional headers on dispatcher vhost | Community
Skip to main content
Level 2
September 27, 2021
Solved

Additional headers on dispatcher vhost

  • September 27, 2021
  • 3 replies
  • 5725 views

Hi All , 

We are planning to add below  additional header in vhost of the application. Can you please suggest ways to implement it.

Header name: endpointRequested

 

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

@sriga311 

 

I don't see it has any value. Can you try the below?

 

Header set X-endPointRequested "www.google.com"

 You need to read the ednPoint dynamically and apply here as variable. Before that ensure it is working by hardcoding some value like I did for google.com

 

Thanks!

3 replies

Kishore_Kumar_
Level 9
September 27, 2021
Raja-Karuppsamy
Community Advisor
Community Advisor
September 27, 2021

Link throws 404 page

Kishore_Kumar_
Level 9
September 27, 2021

Hi raja,

 

Updated, thanks.

Asutosh_Jena_
Community Advisor
Community Advisor
September 27, 2021

Hi @sriga311 

 

You can add additional request headers in the v-host file like below:

 

<VirtualHost *:443>
ServerName ${SERVER_IP}
ServerAlias ${NO_SUBDOMAIN_ALIAS}
Header always append X-Frame-Options SAMEORIGIN
Header set Keep-Alive 'timeout=10, max=98'
Header set X-XSS-Protection "1; mode=block"
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains;"
Header set X-Content-Type-Options nosniff
</VirtualHost>
Sriga311Author
Level 2
September 28, 2021

Hi @asutosh_jena_ ,

W e have added the additional header as below in the vhost .But on restarting the  dispatcher , it got failed .So ,could you please let me know whether this is a wrong approach.

 

<IfModule mod_headers.c>
Header set endpointRequested
</IfModule>

 

Thanks.

Asutosh_Jena_
Community Advisor
Community Advisor
September 28, 2021

It is based on individual vhost where we define the server name as below .

ServerName www.xyz.com
ServerAlias www.xyz.com preview.xyz.com

 

Thanks

 


I mean what value are you expecting here. Let's say your website URL is www.mywebsite.com

so when I access anypage with this domain what is the expected value for endPointURL header? Also does this value changes anytime or it remains constant always irrespective of any user accessing the page?

Anny0505
Community Advisor
Community Advisor
September 27, 2021

I think this is another wy of adding client headers through farm file along with Virtual host.

 

I think this also another way of setting client headers through farm file.

 

Below are the allowed client headers. h

 

/clientheaders
{
"CSRF-Token"
"X-Forwarded-Proto"
"referer"
"user-agent"
"authorization"
"from"
"content-type"
"content-length"
"accept-charset"
"accept-encoding"
"accept-language"
"accept"
"host"
"if-match"
"if-none-match"
"if-range"
"if-unmodified-since"
"max-forwards"
"proxy-authorization"
"proxy-connection"
"range"
"cookie"
"cq-action"
"cq-handle"
"handle"
"action"
"cqstats"
"depth"
"translate"
"expires"
"date"
"dav"
"ms-author-via"
"if"
"lock-token"
"x-expected-entity-length"
"destination"
"PATH"
}

Thanks,

Aruna