[BUG] Invalid HTTP Request
See original GitHub issueWhen trying to access the Web UI from https://domain.com/youtube-dl
I get a 502 error and see the following in the logs
WARNING: Invalid HTTP request received.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 170, in handle_events
event = self.conn.next_event()
File "/usr/local/lib/python3.9/site-packages/h11/_connection.py", line 443, in next_event
exc._reraise_as_remote_protocol_error()
File "/usr/local/lib/python3.9/site-packages/h11/_util.py", line 76, in _reraise_as_remote_protocol_error
raise self
File "/usr/local/lib/python3.9/site-packages/h11/_connection.py", line 425, in next_event
event = self._extract_next_receive_event()
File "/usr/local/lib/python3.9/site-packages/h11/_connection.py", line 367, in _extract_next_receive_event
event = self._reader(self._receive_buffer)
File "/usr/local/lib/python3.9/site-packages/h11/_readers.py", line 75, in maybe_read_from_IDLE_client
return Request(
File "/usr/local/lib/python3.9/site-packages/h11/_events.py", line 71, in __init__
self._validate()
File "/usr/local/lib/python3.9/site-packages/h11/_events.py", line 142, in _validate
raise LocalProtocolError("Found multiple Host: headers")
h11._util.RemoteProtocolError: Found multiple Host: headers
I’m running NGINX with LetsEncrypt and my main domain is behind a CF proxy and this had never been an issue.
This is my nginx.conf
## Version 2020/09/01 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx.conf
user abc;
worker_processes 4;
pid /run/nginx.pid;
include /etc/nginx/modules/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
variables_hash_max_size 2048;
large_client_header_buffers 4 16k;
client_max_body_size 0;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /config/log/nginx/access.log;
error_log /config/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# CF Real IP
##
include cf_real-ip.conf;
real_ip_header X-Forwarded-For;
##
# Theme Park
##
map $host $theme {
default organizr-dark;
}
##
# WebSocket proxying
##
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /config/nginx/site-confs/*;
lua_load_resty_core off;
}
daemon off;
This is my proxy.conf
## Version 2020/09/01 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/proxy.conf
client_body_buffer_size 128k;
#Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# Advanced Proxy Config
send_timeout 5m;
proxy_read_timeout 240;
proxy_send_timeout 240;
proxy_connect_timeout 240;
# TLS 1.3 early data
proxy_set_header Early-Data $ssl_early_data;
# Basic Proxy Config
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_redirect http:// $scheme://;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
#proxy_cookie_path / "/; HTTPOnly; Secure"; # enable at your own risk, may break certain apps
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
## Plex Login Error - API Connection Failed Fix?
proxy_buffer_size 128k;
proxy_busy_buffers_size 256k;
proxy_buffers 4 256k;
This is my ssl.conf
## Version 2020/06/17 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/ssl.conf
### Mozilla Recommendations
# generated 2020-06-17, Mozilla Guideline v5.4, nginx 1.18.0-r0, OpenSSL 1.1.1g-r0, intermediate configuration
# https://ssl-config.mozilla.org/#server=nginx&version=1.18.0-r0&config=intermediate&openssl=1.1.1g-r0&guideline=5.4
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
# intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;
### Linuxserver.io Defaults
# Certificates
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /config/keys/letsencrypt/fullchain.pem;
# Diffie-Hellman Parameters
ssl_dhparam /config/nginx/dhparams.pem;
# Resolver
resolver 127.0.0.11 valid=30s; # Docker DNS Server
# Enable TLS 1.3 early data
ssl_early_data on;
# HSTS, remove # from the line below to enable HSTS
add_header Strict-Transport-Security "max-age=15770000; includeSubDomains; preload" always;
# Optional additional headers
add_header Content-Security-Policy "upgrade-insecure-requests";
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-UA-Compatible "IE=Edge" always;
add_header Cache-Control "no-transform" always;
add_header Referrer-Policy "same-origin" always;
add_header Content-Security-Policy "frame-ancestors https://domain.xyz";
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (6 by maintainers)
Top Results From Across the Web
Stuck with: WARNING: Invalid HTTP request received. #441
4.6', 59220) - "GET /item HTTP/1.1" 200 2020-04-03T23:11:10.644182218Z [2020-04-03 23:11:10 +0000] [7] [WARNING] Invalid HTTP request received.
Read more >Bug #849: Not alerting on invalid http request Content-Length
In situation 2) wireshark does not recognize the http request - just recognizes it as valid TCP segment , which would be correct...
Read more >Invalid HTTP version triggers text/plain or text/xml rendering
1.Visit a page/site that returns HTTP/2.0 a change in the major protocol version number in http means an incompatible change in the parsing...
Read more >Azure SAML SSO error: invalid HTTP request : r/fortinet - Reddit
Azure SAML SSO error: invalid HTTP request. I'm configuring SAML SSO with conditional access on our Fortigate's VPN connection.
Read more >Bug #68745 :: Invalid HTTP requests make web server segfault
Start the built-in web server on this file: php -S localhost:8888 test.php 3. Run this PHP code to send an invalid HTTP request:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I made a pull request: https://github.com/linuxserver/reverse-proxy-confs/pull/287
Commenting this line out fixed it!
@blackerking maybe have LSIO update the
.conf
for youtube-dl?