Blazor WASM - CORS #19
-
Hey, I've been developing a site using the Blazor wasm template and I am now trying to get it hosted. I'm using the included docker compose scripts and deploying it to my own VPS using the included github actions. I'm not hosting the ui on a cdn due to this issue so thought it would be easier to keep them together for now. However no matter what configuration I try in the AppHost.Configure I'm always getting the following error:
I have reverted back to the original configuration in the template but still getting the error: I've tried removing cors altogether seen as I'm not deploying to a cdn but I still get the issue. Not sure what I'm missing, any help would be appreicated. Many thanks. Tom |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I've got it hosted on github pages now, but still getting the same error. Looking at the example template I can see that the requests send across the following headers: I can see that my site does not send these headers. |
Beta Was this translation helpful? Give feedback.
-
If you're not deploying to a CDN then you should not be running into any CORS issue since the client and server would be deployed and hosted at the same site so there would be no need for CORS. FYI we've found a workaround of git's new fatal: unsafe repository issue by using a different action to deploy to GitHub Pages: |
Beta Was this translation helpful? Give feedback.
-
Turns out the CORS error was actually hiding the SSL error. |
Beta Was this translation helpful? Give feedback.
Turns out the CORS error was actually hiding the SSL error.
Set up a domain, rebuilt the nginx container and all is working now.