cloudflare / quiche

🥧 Savoury implementation of the QUIC transport protocol and HTTP/3
https://docs.quic.tech/quiche/
BSD 2-Clause "Simplified" License
9.29k stars 697 forks source link

Can I use a POST requests with Quiche HTTP/3 ? #1274

Open BohdanVovkotrub opened 2 years ago

BohdanVovkotrub commented 2 years ago

Hi !

I have a simple NodeJS web-server http://localhost:5000 which receive a "GET / " and "POST / " requests. NGINX with Quiche connected to him by "proxy_pass" :

location / {
    proxy_pass http://localhost:5000;
}

GET requests works fine! But POST doesn't work.

I try to send some data by method POST e.g.:

$.ajax({ 
        url: "/",
        type: "post",
        data: {myfield: "test"}
})

Then I have an error 500 Internal error "epoll_ctl(1, 6) failed (17: File exists), client: 192.168.254.1, server: , request: "POST / HTTP/3" "

Am I correctly understand that I cannot use a POST requests ? Or maybe my config is bad?

Here is my nginx.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
    worker_connections 2048;
    use epoll;
    multi_accept on;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    aio threads;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    server_tokens off;

    gzip on;
    gzip_vary on;
    gzip_comp_level 6;
    gzip_proxied any;
    gzip_types *;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*.conf;

    server {
        # Enable QUIC and HTTP/3.
        listen 443 quic reuseport;

        # Enable HTTP/2 (optional).
        listen 443 ssl http2;

    ssl_early_data on;

        ssl_certificate      /home/administrator/myProjects/test-nginx-quic/cert/fullchain.pem;     #cert.crt;
        ssl_certificate_key  /home/administrator/myProjects/test-nginx-quic/cert/privkey.pem;       #cert.key;

        # Enable all TLS versions (TLSv1.3 is required for QUIC).
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;

        # Add Alt-Svc header to negotiate HTTP/3.
        add_header Alt-Svc 'h3=":443"; ma=86400';
    #add_header QUIC-Status $quic;

    location / {
        proxy_pass http://localhost:5000;
    }
    }   
}

Please, help me send POST requests over HTTP/3 Thanks!

LPardue commented 1 year ago

The quiche patch to nginx only support HTTP/3 for receiving requests and sending responses from the downstream. It doesn't support sending HTTP/3 to an upstream.