question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP->HTTPS redirection assumes the request contains a host header

See original GitHub issue

Error description

Jupyterlab and proxy http to https work fine but getting this error. Log from /var/log/messeges:

Apr 28 03:20:33 jupyter jupyterhub[2015]: 03:20:33.871 [ConfigProxy] #033[31merror#033[39m: Uncaught Exception: Cannot read property 'split' of undefined
Apr 28 03:20:33 jupyter jupyterhub[2015]: 03:20:33.871 [ConfigProxy] #033[31merror#033[39m: TypeError: Cannot read property 'split' of undefined
Apr 28 03:20:33 jupyter jupyterhub[2015]:    at Server.<anonymous> (/usr/lib/node_modules/configurable-http-proxy/bin/configurable-http-proxy:382:35)
Apr 28 03:20:33 jupyter jupyterhub[2015]:    at Server.emit (events.js:198:13)
Apr 28 03:20:33 jupyter jupyterhub[2015]:    at parserOnIncoming (_http_server.js:691:12)
Apr 28 03:20:33 jupyter jupyterhub[2015]:    at HTTPParser.parserOnHeadersComplete (_http_common.js:111:17)

Systemctl:

$ systemctl status jupyterhub
● jupyterhub.service - Jupyterhub
   Loaded: loaded (/usr/lib/systemd/system/jupyterhub.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2020-04-27 20:20:05 CEST; 12h ago
 Main PID: 2015 (jupyterhub)
    Tasks: 25 (limit: 23844)
   Memory: 104.5M
   CGroup: /system.slice/jupyterhub.service
           ├─2015 /usr/bin/python3.6 /usr/local/bin/jupyterhub -f /etc/jupyterhub/jupyterhub_config.py
           ├─2025 node /usr/bin/configurable-http-proxy --redirect-port 80 --ip jupyter.example.com --port 443 --api-ip localhost --api-port 8001 --error-target http://192.168.103.202:8443/h>
           └─2037 python3 /root/jupyterhub_services/cull_idle_servers.py --timeout=8640

Personal set up

  • OS: Linux 4.18.0-147.8.1.el8_1.x86_64 CentOS Linux release 8.1.1911 (Core)
  • Version: jupyterhub 1.1.0 configurable-http-proxy 4.2.1
  • Configuration: /etc/jupyterhub/jupyterhub_config.py
c.JupyterHub.cleanup_proxy = False
c.JupyterHub.cleanup_servers = False
c.ConfigurableHTTPProxy.command = ['configurable-http-proxy', '--redirect-port', '80']
c.ConfigurableHTTPProxy.api_url = 'http://localhost:8001'
c.JupyterHub.hub_ip = "192.168.103.202"
c.JupyterHub.hub_port = 8443
c.JupyterHub.bind_url = 'https://jupyter.example.com:443'
c.JupyterHub.ssl_cert = '/etc/jupyterhub/jupyter.crt'
c.JupyterHub.ssl_key = '/etc/jupyterhub/jupyter.key'
c.Spawner.default_url = '/lab'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
manicscommented, May 29, 2020

HTTP 1.1 requires a Host header, HTTP 1.0 doesn’t (though I didn’t think any browsers still used HTTP 1.0!). If you’ve only got one domain hosted on an IP you don’t need a host header since the certificate verification is done on the client side, and the client knows what address it connected to. If you’ve got multiple virtualhosts the server must support Server Name Indication and the client must send the host so the server knows which certificate to return, if it doesn’t the server normally returns a default certificate.

0reactions
belavicmcommented, Jun 3, 2020

I can’t reproduce the bug because my browser is not a problem (using HTTP 1.1). Maybe the problem is with one of the monitoring services (Zabbix, Wazuh, Puppet, etc.)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Host header attacks | Web Security Academy
The purpose of the HTTP Host header is to help identify which back-end component the client wants to communicate with. If requests didn't...
Read more >
Host Header - What is an HTTP Host Header injection?
Ambiguous requests that contain duplicate host headers, absolute URLs in the request line, along with a host header, indented headers, etc.
Read more >
What is HTTP "Host" header? - Stack Overflow
A Host header field must be sent in all HTTP/1.1 request messages. ... The "Host" header field in a request provides the host...
Read more >
Rewrite Host Header i-rule question - DevCentral
Hi all. I'm interested in changing the Http host header when an http request occurs. I searched a little bit and I found...
Read more >
HTTP/1.1: Header Field Definitions
If no Accept-Encoding field is present in a request, the server MAY assume that the client will accept any content coding. In this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found