博客
关于我
OpenResty & Nginx:详细对比与部署指南
阅读量:791 次
发布时间:2023-02-24

本文共 2031 字,大约阅读时间需要 6 分钟。

Nginx ? OpenResty ?????? Web ???????????????????????????? Web ?????????????????????????

Nginx ??

Nginx ? Igor Sysoev ? 2004 ??????? HTTP ? IMAP/POP3 ???????????????????????????????????????????????????????????? Apache ???????? Web ??????

Nginx ?????

  • ?????Nginx ??? HTTP ??????????????????????????
  • ?????Nginx ?? IMAP ? POP3 ??????????????
  • ???????Nginx ?????? HTML?CSS?JavaScript ???????????
  • ????????? Gzip ??? FastCGI??????????
  • Nginx ?????

    • Web ???????? Web ???????
    • ???????? IMAP ? POP3 ???
    • API ?????????????? API ???

    OpenResty ??

    OpenResty ??? Nginx ??????????????? Lua ??????????????????? Web ??? API ???????? Nginx ????? Lua ?????????????????????

    OpenResty ?????

  • Lua ????? Lua ?????????????????
  • ??????????????? ngx_lua?ngx_redis ???????????
  • ????? Nginx ???OpenResty ??????????????
  • ?????? LuaJIT ????????????
  • OpenResty ?????

    • ??? Web ???????? Web ???
    • API ????? Lua ????? API ???
    • ??????? Redis?Memcached ??????????????

    ?????

    Nginx ??

  • ???????? Nginx?
  • sudo apt updatesudo apt install nginx
    1. ?????
    2. sudo systemctl start nginxsudo systemctl enable nginx
      1. ?? Nginx??????? /etc/nginx/nginx.conf?????????
      2. server {    listen 80;    server_name example.com;    location / {        root /var/www/html;        index index.html index.htm;    }}
        1. ?????
        2. sudo nginx -tsudo systemctl restart nginx

          OpenResty ??

        3. ?? OpenResty ???
        4. sudo apt updatesudo apt install -y software-properties-commonsudo add-apt-repository -y ppa:openresty/ppasudo apt update
          1. ?? OpenResty?
          2. sudo apt install -y openresty
            1. ?????
            2. sudo systemctl start openrestysudo systemctl enable openresty
              1. ?? OpenResty??????? /usr/local/openresty/nginx/conf/nginx.conf?????????
              2. http {    server {        listen 80;        server_name example.com;        location / {            content_by_lua_block {                ngx.say("Hello, OpenResty!");            }        }    }}
                1. ?????
                2. sudo /usr/local/openresty/nginx/sbin/nginx -tsudo systemctl restart openresty

                  ??

                  Nginx ? OpenResty ?????????????Nginx ?????????????????? OpenResty ????????? Lua ???????????? Web ??? API ?????????????????????????????????

    转载地址:http://jcpfk.baihongyu.com/

    你可能感兴趣的文章
    Objective-C实现醉汉随机行走问题(附完整源码)
    查看>>
    Objective-C实现重载[ ](附完整源码)
    查看>>
    Objective-C实现随机图生成器算法(附完整源码)
    查看>>
    Objective-C实现高斯消元法(附完整源码)
    查看>>
    Objective-C语法之代码块(block)的使用
    查看>>
    Objenesis创建类的实例
    查看>>
    OC Xcode快捷键
    查看>>
    OC 内存管理黄金法则
    查看>>
    OfficeWeb365 SaveDraw 文件上传漏洞复现
    查看>>
    office中的所有content type
    查看>>
    office之Excel 你会用 Ctrl + E 吗?
    查看>>
    OGG初始化之使用数据库实用程序加载数据
    查看>>
    ogg参数解析
    查看>>
    ognl详解
    查看>>
    Oil Deposits
    查看>>
    OJ中处理超大数据的方法
    查看>>
    OJ中常见的一种presentation error解决方法
    查看>>
    OK335xS UART device registe hacking
    查看>>
    ok6410内存初始化
    查看>>
    Okhttp3添加拦截器后,报错,java.io.IOException: unexpected end of stream on okhttp3.Address
    查看>>