openresty——安装 配置 使用

安装

wget https://openresty.org/package/centos/openresty.repo

mv openresty.repo /etc/yum.repos.d/

ll /etc/yum.repos.d/

yum list | grep openresty 

yum install -y openresty.x86_64

service openresty status

service openresty start

/usr/local/openresty/nginx/sbin/nginx -v

vim /usr/local/openresty/nginx/conf/nginx.conf

/usr/local/openresty/nginx/sbin/nginx -s reload

支持lua 配置文件添加

 #lua 缓存(每次修改lua后需要重启)默认是开启 on , 开发阶段建议关闭,生产环境必须开启 
    lua_code_cache on;
    lua_package_path  "/root/data/acgn/game_res/?.lua;/root/data/acgn/game_res/script/?.lua;/root/data/acgn/game_res/serverbattle/src/?.lua;;"; #lua 模块   
    server {
        listen       8009;
        server_name  localhost;

        client_max_body_size 50m;
        client_body_buffer_size 10m;

        location /battle_callback {
            default_type text/plain;
            content_by_lua_file /root/data/acgn/game_res/blaze_battle.lua;
        }

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

 

上一篇:Bugku_隐写 [Study notes][MISC]


下一篇:00_3面向对象设计原则-单一职责