Recently, I have been getting http/1.1 500 internal server error when I build and publish to WebGL in Unity. Sometimes the project builds and publishes to webGL successfully but only loads up to 90% online and then fails to work.
The code of my project contains web requests and download handlers.
There are different suggestions to fix the issue.
Restart Unity Editor and Unity Hub
Restart the PC
Change the player project settings
Not blocking WebRequest in the code. Get rid of while, if and other statements that may block the request.
I have tried all these suggestions. None seems to fix the issue.
The error is random. My project sometimes builds and publishes successfully to webGL, and sometimes I get the 500 internal server error.
This randomness may confuse a person about what solution would work. If the project randomly publishes successfully to the web, a person may think that the fix they tried is the right answer.
So, I thought, what if I keep trying to build and publish to WebGL over and over until the publishing is successful?
It worked eventually.
I still don’t understand the reason for that error, given 500 internal server error is general by nature. It could be a Unity bug or something else.
However, the repetitive trial of building and publishing to webGL seems a temporary fix.
On this page of the site you can watch the video online 500 Internal Server Error When Publish to WebGL in Unity with a duration of hours minute second in good quality, which was uploaded by the user DA LAB 01 December 2022, share the link with friends and acquaintances, this video has already been watched 1,945 times on youtube and it was liked by 16 viewers. Enjoy your viewing!