Search Unity

Webgl doesn't work on the server side

Discussion in 'Web' started by jackheroes, Sep 23, 2016.

  1. jackheroes

    jackheroes

    Joined:
    Jun 11, 2016
    Posts:
    4
    I built my project for WebGL with unity5.35.
    And got "Release directory", "TemplateData directory", "Index.html".
    Double clicking index.html locally to open the game works fine for me.
    But after I uploaded these three to the server( a virtual server I rent ),
    I tried to open it with FireFox brower, it open the page correctly, but doesn't load the game.
    something like this: http://jackheroes.0343.bftii.com/
     
  2. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    That link you posted doesnt work.

    Maybe you can first try creating your own local webserver on your local computer and trying it there to work out all the kinks.

    One easy server to install (that I use for testing) is WAMP.
     
  3. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    Hi, i have a similar error, locally the build work, but when i load it on a server the error is this:
    SyntaxError: expected expression, got '<'

    The link of the build is this:
    http://www.maxromagnoli.com/Games/Casino/
     
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    I think your server is not configured properly. See the manual for more info.
     
    RoMax92 likes this.
  5. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    SOLVED!

    Thanks to the manual i discovered i have to add a file for my Windows Based server, now all it's perectly working!
    Thanks a lot @Marco-Trivellato ! :D