Skip to content

xquic server 配置,curl成功走h3, 但是浏览器始终无法走h3,每一次都是h2,server也没有h3请求,包头中也有Alt-Svc #2002

Description

@yangzhewen

Question

xquic server 配置,curl成功走h3, 但是浏览器始终无法走h3,每一次都是h2,server也没有h3请求,包头中也有Alt-Svc

config如下:

user root;
#user nobody;

worker_processes 1;
xquic_log "pipe:rollback /usr/local/tengine/logs/tengine-xquic.log baknum=10 maxsize=1G interval=1d adjust=600" debug;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#error_log "pipe:rollback logs/error_log interval=1d baknum=7 maxsize=2G";
error_log logs/error.log debug;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
xquic_ssl_certificate /home/zhewen-yang/work/tengine_xquic/s1.test.com.pem;
xquic_ssl_certificate_key /home/zhewen-yang/work/tengine_xquic/s1.test.com-key.pem;
xquic_ssl_session_ticket_key /etc/tengine/ssl/session_ticket.key;

xquic_congestion_control bbr;
xquic_socket_rcvbuf 5242880;
xquic_socket_sndbuf 5242880;
xquic_anti_amplification_limit 5;

include       mime.types;
default_type  application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;
#access_log  "pipe:rollback logs/access_log interval=1d baknum=7 maxsize=2G"  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;

#server {
    #listen 2443 xquic reuseport;
   # server_name  localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;
    #access_log  "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G"  main;

  #  location / {

  #  }



    #location /video/ {
    #root /home/zhewen-yang/work/sbd/mpquic-sbd/example/;
     #   add_header Access-Control-Allow-Origin *;
      #  add_header Access-Control-Allow-Headers *;
       # add_header Access-Control-Allow-Methods GET,HEAD,OPTIONS;
    #types {
     #   application/dash+xml mpd;
      #  video/iso.segment m4s;
    #}
     #   default_type application/octet-stream;
      #  add_header Accept-Ranges bytes;
    #}


    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    #error_page   500 502 503 504  /50x.html;
    #location = /50x.html {
       # root   html;
    #}

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # pass the Dubbo rpc to Dubbo provider server listening on 127.0.0.1:20880
    #
    #location /dubbo {
    #    dubbo_pass_all_headers on;
    #    dubbo_pass_set args $args;
    #    dubbo_pass_set uri $uri;
    #    dubbo_pass_set method $request_method;
    #
    #    dubbo_pass org.apache.dubbo.samples.tengine.DemoService 0.0.0 tengineDubbo dubbo_backend;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
#}

    server {
    #listen 800 default_server reuseport backlog=4096;
    listen 443 default_server reuseport backlog=4096 ssl http2;
    listen 443 default_server reuseport backlog=4096 xquic;

    server_name s1.test.com;

    add_header Alt-Svc 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000' always;

    ssl_protocols       TLSv1.3;
    ssl_certificate     /home/zhewen-yang/work/tengine_xquic/s1.test.com.pem;
    ssl_certificate_key /home/zhewen-yang/work/tengine_xquic/s1.test.com-key.pem;
    ssl_session_tickets on;
    ssl_session_ticket_key /etc/tengine/ssl/session_ticket.key;

    location / {
    root /usr/local/tengine/html;
    index index.html;
}
 location /video/ {
    root /home/zhewen-yang/work/sbd/mpquic-sbd/example/;
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Headers *;
        add_header Access-Control-Allow-Methods GET,HEAD,OPTIONS;
    types {
        application/dash+xml mpd;
        video/iso.segment m4s;
    }
        default_type application/octet-stream;
        add_header Accept-Ranges bytes;
    }
}

# upstream for Dubbo rpc to Dubbo provider server listening on 127.0.0.1:20880
#
#upstream dubbo_backend {
#    multi 1;
#    server 127.0.0.1:20880;
#}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}


# HTTPS server
#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}

Activity

  1. yangzhewen commented on Jun 17, 2025

    @yangzhewen
    Author

    127.0.0.1 - - [17/Jun/2025:18:40:16 -0400] "GET /video/bbb100m/left/left_100_from200_dash.mpd HTTP/3.0" 200 5076 "-" "curl/8.15.0-DEV"
    127.0.0.1 - - [17/Jun/2025:18:40:25 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
    127.0.0.1 - - [17/Jun/2025:18:40:26 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
    127.0.0.1 - - [17/Jun/2025:18:40:26 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
    127.0.0.1 - - [17/Jun/2025:18:40:26 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
    127.0.0.1 - - [17/Jun/2025:18:40:27 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
    127.0.0.1 - - [17/Jun/2025:18:40:27 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"
    127.0.0.1 - - [17/Jun/2025:18:40:27 -0400] "GET / HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0"

  2. drawing commented on Jun 18, 2025

    @drawing
    Collaborator

    证书是受信的么

  3. yangzhewen commented on Jun 18, 2025

    @yangzhewen
    Author

    使用 mkcert生成的证书,在火狐左上角的锁显示信任

    Image

    Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions