add exception in documentation with nginx and cloudflare
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
In the nginx configuration documentation you should mention cloudflare + nginx configuration.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-7.0#configure-nginx
I had a problem where the blazor connection looped because there was a problem with the web socket connection.
This code solved my problem:
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_session_reuse off;
proxy_cache_bypass $http_upgrade;
and more specifically
proxy_set_header Connection "upgrade";
without it, such magic works and it kept throwing me the error 500 + ssl handshake failed
https://gyazo.com/6bae286bb75d2e9e4bef84f8057a0c48
My config:
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ****
ssl_certificate /etc/ssl/***;
ssl_certificate_key /etc/ssl/***;
ssl_session_timeout 1d;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling off;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
location / {
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;
client_max_body_size 32M;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_session_reuse off;
proxy_cache_bypass $http_upgrade;
proxy_pass http://localhost:5001/;
proxy_http_version 1.1;
}
Describe the solution you’d like
It’s worth looking into this issue and mentioning it in the documentation or solving it in some other way.
Additional context
No response
Issue Analytics
- State:
- Created 9 months ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Nginx Reverse Proxy and Cloudflare issues - DNS & Network
I am using Cloudflare as my DNS for my website everything works great. I recently setup a Nginx Reverse Proxy in order to...
Read more >How To Host a Website Using Cloudflare and Nginx on ...
Now go to the Cloudflare dashboard's SSL/TLS section, navigate to the Overview tab, and change SSL/TLS encryption mode to Full (strict). This ...
Read more >A quick guide to free HTTPS with Cloudflare and Nginx
After you've bought a domain name, log in to Cloudflare. We want to 'add a site', which is a button in the toolbar...
Read more >Nginx not working with Cloudflare : r/nginxproxymanager
The issue is that when I add my pointed A record from Cloudflare to a domain, the site will load forever before giving...
Read more >Avoiding the Top 10 NGINX Configuration Mistakes
We help you avoid the 10 most common NGINX configuration errors, explaining the problems caused by each and how to fix them.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Right after the nginx config snippet there is a sentence telling you to go to SignalR/Blazor specific docs for additional configuration
@darkedges file a new issue.