nginx部署网页小游戏

使用Nginx做网站小游戏

1.手写nginx从配置文件
vim /etc/nginx/conf.d/game.conf
server {
        listen 80;
        server_name game.syy.com;

        location / {
        #location可以省略
        
                root /code;
                index index.html
        }
}

2.#小游戏的HTML和解压后别的文件要放一起,因为他们本来就是一个整体,记得gzip备份index.html
mkdir /code/ && cd /code/
rz  html5.zip
unzip html5.zip

3.检查和检验
nginx -t

4.重载nginx配置文件
systemctl reload nginx

5.配置windows本地域名解析
vim /etc/hosts

6.#检测解析是否加载(ping域名或者,再次打开hosts文件查看)
ping game.syy.com

7.浏览器检测
http://game.syy.com/

原文地址:https://www.cnblogs.com/syy1757528181/p/12900122.html