I'm trying to run default Blazor WebAssembly project template on my web server. Project, when ran locally, works without any problems. Problem appears after I deploy it to server.
I can successfully navigate to any page that doesn't require authentication. However, when I try to enter the one requiring login, I can see such message:
There was an error trying to log you in: 'Network Error'
In web browser console I can see:
Blocked loading mixed active content āhttp://[subdomain.domain.com]/.well-known/openid-configurationā
In Firefox's "Network" tab, request is marked as "Blocked".
My webserver runs on Nginx which acts as reverse proxy. I planned to keep HTTPS encryption configured between internet and Nginx. Communication between Nginx and other services were meant to be over plain HTTP. Here is my Nginx config:
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
}
[...]
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name subdomain.domain.com;
ssl_certificate /etc/nginx_ssl/live/fullchain.pem;
ssl_certificate_key /etc/nginx_ssl/live/privkey.pem;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://blazorapp:80;
proxy_redirect off;
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_set_header X-Forwarded-Host $server_name;
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;
}
}
My guesses
As you can see from browser error message, browser tries to access .well-known/openid-configuration over HTTP, not HTTPS. The problem possibly lays here.
Do you have any ideas what could be wrong?
