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

Blazor SSR stream rendering not working when i deploy to nginx server on linux #55660

Closed
1 task done
sardar97 opened this issue May 10, 2024 · 7 comments
Closed
1 task done
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-streaming-rendering Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.

Comments

@sardar97
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

when I run the app on localhost stream rendering works fine with ssr rendering but when I deploy it to nginx server on linux
it is not Working !.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

.net v8.0.204

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label May 10, 2024
@javiercn
Copy link
Member

@sardar97 thanks for contacting us.

Check that you are not buffering the response on nginx. If the server buffers the response before sending it back it will prevent streaming rendering from having an effect.

@javiercn javiercn added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label May 11, 2024
@sardar97
Copy link
Author

this is my site-enabled config please let me know if it is wrong or it is make buffering on! and shall i share nginx.conf as well?

 
server {


        server_name sardarqaslany.com *.sardarqaslany.com;

         location / {
                proxy_pass         http://localhost:5001/;
                proxy_http_version 1.1;
                proxy_set_header   Upgrade $http_upgrade;
                proxy_set_header   Connection $connection_upgrade;
                proxy_set_header   Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header   X-Forwarded-Proto $scheme;
        }



    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/sardarqaslany.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/sardarqaslany.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}
server {
    if ($host = www.sardarqaslany.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = sardarqaslany.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot




        server_name sardarqaslany.com *.sardarqaslany.com;
    listen 80;
    return 404; # managed by Certbot




}

 

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 12, 2024
@javiercn
Copy link
Member

@sardar97 thanks for the additional details.

Unfortunately, we aren't nginx experts and can't help with this request. We suggest you ask on stack overflow or the nginx docs on how buffering works in nginx in particular.

@sardar97
Copy link
Author

but this is Stream Rendering issue have you tried with nginx? and dotnet 8? this is something i yhink microsoft should test before even release!

@mkArtakMSFT
Copy link
Member

One pattern we observed is that customers who discovered that it's not working had some buffering configuration enabled on their servers / proxies. See if this helps: https://learn.microsoft.com/en-us/aspnet/core/signalr/scale?view=aspnetcore-8.0#linux-with-nginx

@mkArtakMSFT mkArtakMSFT added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels May 13, 2024
Copy link
Contributor

Hi @sardar97. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@sardar97
Copy link
Author

thank u very much @mkArtakMSFT I fixed it by adding this proxy_buffering off;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-streaming-rendering Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.
Projects
None yet
Development

No branches or pull requests

3 participants