Skip to content

Serving http/1.1 not http2 #2628

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

Open
jh197033 opened this issue Jun 7, 2025 · 1 comment
Open

Serving http/1.1 not http2 #2628

jh197033 opened this issue Jun 7, 2025 · 1 comment

Comments

@jh197033
Copy link

jh197033 commented Jun 7, 2025

I am using the following docker compose to bring up nginx proxy:

services:

  ams_nginx_proxy:
    image: nginxproxy/nginx-proxy
    container_name: ams_nginx_proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /home/docker/AMS/AMS_Solution/Docker/Volumes/nginx_config/my_config.conf:/etc/nginx/conf.d/my_config.conf:ro
      - /home/docker/AMS/AMS_Solution/Docker/Volumes/nginx_config/vhost/www.xxx.com_location_override:/etc/nginx/vhost.d/www.xxx.com_location_override
      - certs:/etc/nginx/certs
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
    restart: unless-stopped
    networks:
        ams_network:
          ipv4_address: 10.0.0.6

  ams_nginx_proxy_acme:
    image: nginxproxy/acme-companion
    container_name: ams_nginx_proxy_acme
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - certs:/etc/nginx/certs
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - acme:/etc/acme.sh
    environment:
      - [email protected]
      - NGINX_PROXY_CONTAINER=ams_nginx_proxy
    restart: unless-stopped
    networks:
        ams_network:
          ipv4_address: 10.0.0.7

networks:
  ams_network:
    driver: bridge
    ipam:
      config:
        - subnet: 10.0.0.0/24

volumes:
  certs:
  vhost:
  html:
  acme:

And then docker compose to bring up a website:

ams_accounting_web:
        image: ams_accounting_web_amd64:latest
        container_name: ams_accounting_web
        ports:
            - 1102:1102
        environment:
            - VIRTUAL_HOST=accounting.xxx.com
            - LETSENCRYPT_HOST=accounting.xxx.com
            - ASPNETCORE_URLS=http://+:1102
            - ASPNETCORE_ENVIRONMENT=Production
        volumes:
            # - /home/docker/AMS/AMS_Solution/Docker/Volumes/website_config/AMS_UI/AMS_Accounting/AMS.Accounting.Web/appsettings.Production.json:/app/appsettings.Production.json
            - /home/docker/AMS/AMS_Solution/Docker/Volumes/website_data/ams_resources/media:/media
            - /home/docker/AMS/AMS_Solution/Docker/Volumes/website_data/ams_accounting/wwwroot:/wwwroot
        restart: always
        networks:
            ams_nginx_proxy_ams_network:
              ipv4_address: 10.0.0.12

All works ok, but when using google dev tools I get the error that I am using http1.1 and not http2 or 3, what can I do to serve the latest protocol?

Image
@SchoNie
Copy link
Contributor

SchoNie commented Jun 7, 2025

That is not what I experience. Out of the box all is h2 for me.

There could be many reasons why requests are served over http1.1 on your system.
You are using customs configs and overwrites. Please check those.
sudo docker exec ams_nginx_proxy nginx -T will output the generated config. It helps to post.
What are the requests devtools is complaining about? In the devtools > network tab you can see 'Protocol' column. Do you have both h1 and h2 requests? Comparing could help if something is wrong in the configuration.

Enabling http3 is not intrinsically 'better'. h3 requires network changes. You can enable http3 (and also disable http2) if your really want but that will not fix your warnings.

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