nginx/mgx 开启http3 、nginx/mgx 支持 http3

相关网站

安装


http {
        log_format quic '$remote_addr - $remote_user [$time_local] '
                        '"$request" $status $body_bytes_sent '
                        '"$http_referer" "$http_user_agent" "$http3"';

        access_log logs/access.log quic;

        server {
            # for better compatibility it's recommended
            # to use the same port for quic and https
            listen 8443 http3 reuseport;
            listen 8443 ssl;

            ssl_certificate     certs/example.com.crt;
            ssl_certificate_key certs/example.com.key;
            ssl_protocols       TLSv1.3;

            location / {
                # required for browsers to direct them into quic port
                add_header Alt-Svc 'h3=":8443"; ma=86400';
            }
        }
    }

docker-compose.yml


version: '3'
services:
  mgx:
    container_name: mgx
    image: hotpot/mgx:h3
    restart: always
    environment:
      - EMAIL=mgl@mgz.email
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - mgx-data:/etc/letsencrypt
      - $HOME/apps/mgx/conf.d/ssl-conf.d:/config

volumes:
  mgx-data:

注意事项

  • 各种防火墙的udp/tcp 协议的443端口放行
  • docker端口映射时加 "443:443/udp"
本文版权归 123456.blog 所有
转载请附上原文出处链接和本声明
本文链接:
数字工·「」· https://123456.blog ip: 34.225.194.102
Copyright © 2022 Hotpot. All rights reserved. Made with ❤ , 3Q ; Deployed: Kubernetes(k8s),Docker
Design by HotpoT; VvE3 ,NuxT3 123456.blog@0.1.0