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

Nginx Reverse Proxy #15279

Closed
tada5hi opened this issue Oct 26, 2022 · 1 comment
Closed

Nginx Reverse Proxy #15279

tada5hi opened this issue Oct 26, 2022 · 1 comment

Comments

@tada5hi
Copy link
Contributor

tada5hi commented Oct 26, 2022

Environment


  • Operating System: Linux
  • Node Version: v18.11.0
  • Nuxt Version: 3.0.0-rc.12
  • Nitro Version: 0.6.0
  • Package Manager: npm@8.19.2
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

/etc/nginx/sites-enabled/site.conf

server {
    listen 443 ssl http2;

    server_name xxx;

    ssl_certificate /etc/ssl/web/xxx.crt;
    ssl_certificate_key /etc/ssl/web/xxx.key;

    location / {
        http2_push_preload on;

        proxy_redirect                      off;
        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;
        proxy_read_timeout          2m;
        proxy_connect_timeout       2m;

        proxy_buffering           off;
        proxy_cache_bypass                 1;
        proxy_no_cache                     1;

        proxy_pass         http://localhost:3080;
    }

    location /api/ {
        rewrite ^/api(/.*)$ $1 break;

        http2_push_preload on;
        proxy_redirect                      off;
        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;
        proxy_read_timeout          2m;
        proxy_connect_timeout       2m;
        proxy_pass                          http://localhost:3082;
    }
}

Describe the bug

I'm running nuxt and an api behind a reverse proxy (nginx).
Rest API is working fine, but i can not access the nuxt app.
When i try to access the app through the browser, i receive: ERR_HTTP2_PROTOCOL_ERROR
The strange thing is, that static assets, which are served by nuxt (nitro), are working fine, , e.g.
https://xxx.net/css/nuxt-google-fonts.css.

Additional context

No response

Logs

No response

Copy link
Member

This should be resolved in the edge channel, or in the next RC.

You can work around by setting experimental.writeEarlyHints to false.

See #15189

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants