airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Christie (Jira)" <>
Subject [jira] [Commented] (AIRAVATA-3027) Invalid HTTP_HOST header: ''. You may need to add '' to ALLOWED_HOSTS.
Date Thu, 27 Feb 2020 21:35:00 GMT


Marcus Christie commented on AIRAVATA-3027:

So it looks like with virtual hosts, the first defined virtual host for an ip address is the
default. When a hostname doesn't match a ServerName in a set of virtualhost config files,
the "first" one (first alphabetically) ends up handling the request. gives a good overview of the problem
and the two main approaches:

# have a first dummy virtualhost config that won't match anything real or has really low precedence
(named 000-default.conf for example to get it to sort first)
# have a last dummy virtualhost config that matches everything, for example with {{ServerAlias

I think the default.conf file the Ansible scripts already creates works kind of okay but it
has two problems:
- it only works for port 80 requests
- "default" comes before "django-*" and "pga-*" but that's a little accidental. Should be
named 000-default.conf or something better designed to come first.

I also need to figure out how to handle an HTTPS request for the default vhost when I don't
have a valid certificate. Can I get it to redirect to port 80?

> Invalid HTTP_HOST header: ''. You may need to add ''
> ----------------------------------------------------------------------------------------------------------------------
>                 Key: AIRAVATA-3027
>                 URL:
>             Project: Airavata
>          Issue Type: Project
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
> Getting lots of these error emails. I think the root cause is that HTTP requests on the
portal server are matching some virtual host that isn't configured for that domain name. So
for example, we might have a virtual host for, another one for,
etc. but then an HTTP request comes in for the servers IP address and Apache forwards the
request to one of the Django servers. 
> Ultimately what I want is to configure a default virtual host in Apache that rejects
a request for a non-matching domain name.

This message was sent by Atlassian Jira

View raw message