The "host" HTTP header is set by the client to indicate the virtual host that should be used to fulfil the request.
Questions tagged [http-host]
70 questions
2
votes
1 answer
Why there're different host headers when making requests in Next.js?
I host my Next.js app on Amazon Web Services in Elastic Beanstalk inside a docker container. I recently noticed by printing req.host from Express.js that whenever a request is sent to /_next* route the host is myid.elasticebeanstalk.com. In all…

hitchhiker
- 1,099
- 5
- 19
- 44
2
votes
2 answers
newbie .net question - variable that's equivalent of $_SESSION['SERVER_NAME']
I'm still new to .net....I'm trying to find the variable that prints the domain name that an aspx.cs file is currently executing from. I come from PHP land, and it has $_SERVER['SERVER_NAME'] or $_SERVER['HTTP_HOST']. What's the .net equivalent…

John
- 32,403
- 80
- 251
- 422
2
votes
1 answer
Wrong domain with $_SERVER[HTTP_HOST]?
I tried to set up an htaccess file, which simply redirects all urls which are unlike one to another url:
RewriteCond %{HTTP_HOST} !^www.example.com[NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
But i recognized something strange, for…

user3681084
- 259
- 1
- 10
2
votes
0 answers
Apache 2.2 HTTP_HOST not resolving to localhost correctly
Apparently the whole issue is a newly introduced bug in chrome v.24 and host resolving, the htaccess works fine in any other browser.
No idea how to "close" this issue, if someone could point me to it ^^
trying to do a simple rewrite with Apache 2.2…

MichaelHindley
- 485
- 3
- 7
2
votes
3 answers
apache reverse proxy: how to forward proxy server's HTTP_HOST
Our local development setup requires a box in the DMZ, and each developer has a line in its apache config for proxying. Looks something like:
ProxyPreserveHost on
ProxyPass /user1/ {user1's IP}
ProxyPassReverse /user1/ {user1's IP}
ProxyPass…

Ethan
- 400
- 3
- 14
1
vote
1 answer
Need help in simulating (and blocking) HTTP_HOST spoofing attacks
I have an nginx reverse proxy serving multiple small web services. Each of the servers has different domain names, and are individually protected with SSL using Certbot. The installation for these was pretty standard as provided by Ubuntu 20.04.
I…

Kaustubh Bhalerao
- 71
- 5
1
vote
0 answers
Generic way to set a proxy server for a JaxRs client
I have code where the the webtarget is passed to me from a different library. I do not have access to the code to modify the ResteasyClient. What I am trying to do is the equivalent of
Client client = new ResteasyClientBuilderImpl()
…

developer747
- 15,419
- 26
- 93
- 147
1
vote
1 answer
Nginx propagate server_name regex inside Php
In my Nginx configuration there’s
server_name ~^(?.*mygreatsite987778.com.invalid)$ ;
Which works quite good. But When Php does echo $_SERVER['SERVER'], it sees:
~^(?.*mygreatsite987778.com.invalid)$
Despite it seems logical, is there a…
user15129590
1
vote
0 answers
Is it possible to overide HttpRequestHeader Host spring boot
I am trying to override the host of my RequestHeader based on some online resources it stated that setting sun.net.http.allowRestrictedHeaders to true will enable the host to be edited as shown below:
…

user1999453
- 1,297
- 4
- 29
- 65
1
vote
0 answers
Nginx: modifying http_host header using the value from x_custom_header
I've been trying to do this thing for while but nothing working out for me. Hoping if anyone here can help....
The php app here reads $_SERVER['HTTP_HOST'] and then judging host part of the header, it decides which site to serves. The issue here,…

MacUsers
- 2,091
- 3
- 35
- 56
1
vote
1 answer
HttpClient - When to use HttpHost parameter when executing HttpRequest
When using the following code:
URIBuilder uriBuilder = new URIBuilder(url);
HttpPost httpRequest= new HttpPost(uriBuilder.build());
HttpHost httpHost= new HttpHost(uriBuilder.getHost(), uriBuilder.getPort(), uriBuilder.getScheme());
When is it a…

Ori Marko
- 56,308
- 23
- 131
- 233
1
vote
1 answer
Django HTTP_HOST error from probing hackers, how to disable this 500 error?
I'm getting an error message sent to my admin email address:
ADMIN = ['admin.error.email.here@domain.com'] email address.
This error message occurs at a constant rate of around two per minute.
I want to stop all error messages sent to my admin…

quaerere veritatem
- 15
- 5
1
vote
1 answer
mod_rewrite - failing on HTTP host condition
I'm trying to do some URL rewriting - but for some reason it's not working as I expected (I've probably missed something really simple!).
I have two sites - www.domain.local and admin.domain.local. Using the below .htaccess file, the public site…

Kevin
- 57
- 3
- 5
1
vote
4 answers
PHP HTTP_HOST subdomain extraction given that a subdomain be a wildcard and contain more than one '.'
I'm trying to extract the subdomain from the HTTP_HOST value. However I've stumbled into a problem where if the subdomain has more than one dot in it it fails to match properly. Given that this is a script to run on multiple different domains and it…

buggedcom
- 1,537
- 2
- 18
- 34
1
vote
0 answers
About HTTP_HOST & PHP_SELF
i need a if condition, witch detects main url, for one of my important functions.
if ($_SERVER[HTTP_HOST] == www.example.com) { echo its a root page; }
else { echo its a subdomain page; }
my site(magento) is installed in subdomain; and im getting…

Stackyy
- 21
- 4