Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quic proxy_pass #1306

Open
bmrqs opened this issue Aug 25, 2022 · 1 comment
Open

Quic proxy_pass #1306

bmrqs opened this issue Aug 25, 2022 · 1 comment

Comments

@bmrqs
Copy link

bmrqs commented Aug 25, 2022

When using reverse proxy, all requests are responded with 404

@ljluestc
Copy link

# Make sure to include the necessary modules for QUIC and HTTP/3
load_module modules/ngx_http_v3_module.so;

http {
    # Enable HTTP/3
    http3 {
        # Specify the ALPN protocol
        alpn h3-23;
    }
    
    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        # Enable QUIC and HTTP/3
        listen 443 quic reuseport;
        listen [::]:443 quic reuseport;

        # SSL configuration
        ssl_certificate /path/to/your/cert.pem;
        ssl_certificate_key /path/to/your/key.pem;
        ssl_protocols TLSv1.3;
        ssl_prefer_server_ciphers off;
        
        # QUIC and HTTP/3 configuration
        ssl_early_data on;
        ssl_protocols TLSv1.3;
        ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256';

        # ALPN protocols
        http3;
        add_header Alt-Svc 'h3-23=":443"';
        add_header QUIC-Status $quic_status;
        
        # Reverse proxy configuration
        location / {
            proxy_pass http://backend-server;
            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 $scheme;
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants