Unity 2021.3发布WebGL设置以及nginx的配置

使用unity2021.3发布webgl

  1. 使用Unity制作好项目之后建议进行代码清理,这样会即将不用的命名空间去除,不然一会在发布的时候有些命名空间webgl会报错。

  2. 平台转换

    将平台设置为webgl

  3. 设置色彩空间压缩方式

    Compression Format 设置为Disabled

复制代码
Decompression Fallback 设置为false
  1. 构建完成,构建完成的文件


修改nginx配置

直接修改配置文件

复制代码
worker_processes  1;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       7963;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        }
   
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

正确显示网页内容

打开浏览器使用lcoalhost:7963 就能访问了。

相关推荐
不能跑的代码不是好代码8 小时前
Linux系统常用命令中文速查表
linux·运维·服务器
石一峰6999 小时前
深入理解 Linux 中断三层机制与 1-Wire 时序锁原理
linux·运维·服务器
运维老郭9 小时前
PostgreSQL编译安装实战
运维·postgresql
无限码农10 小时前
Linux上通过cmake编译uchardet
linux·运维·服务器
运维大师11 小时前
【Linux运维极简教程】06-网络配置与管理
linux·运维
007张三丰11 小时前
软件测试专栏(15/20):REST Assured接口自动化框架实战
运维·自动化·jenkins·接口自动化·rest·assured
ACP广源盛1392462567311 小时前
IX8024@ACP# 搭配此芯 AI 服务器 + 爱芯元智产品完整方案
大数据·运维·服务器·人工智能·分布式·嵌入式硬件
huainingning14 小时前
交换机通过ftp下载文件或者传输文件到ftp服务器
运维·服务器·网络
edwarddamon14 小时前
CentOS 7 国内安装 Docker CE(阿里云源)
运维
Championship.23.2415 小时前
Linux 3.0 LVDS驱动开发详解
linux·运维·驱动开发·lvds