Openresty Nginx 安装搭建

openresty安装:

1.下载openresty
    wget https://openresty.org/download/openresty-1.15.8.3.tar.gz
2.安装依赖包
    yum -y install gcc gcc-c++  pcre pcre-devel  zlib zlib-devel openssl openssl-devel
3.编译openresty
    ./configure  --with-http_ssl_module  --with-http_iconv_module  --prefix=/home/app/openresty
    make  && make install
4.配置conf
    cd /home/app/openresty/nginx/conf
    vi nginx.conf

1#user  nobody; 2worker_processes  1; 3#error_log  logs/error.log; 4#error_log  logs/error.log  notice; 5#error_log  logs/error.log  info; 6#pid        logs/nginx.pid; 7events { 8    worker_connections  1024; 9} 10http { 11    include       mime.types; 12    default_type  application/octet-stream; 13 14    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' 15                      '$status $body_bytes_sent "$http_referer" ' 16                      '"$http_user_agent" "$http_x_forwarded_for"'; 17 18    access_log  logs/access.log  main; 19 20    sendfile        on; 21    #tcp_nopush     on; 22 23    #keepalive_timeout  0; 24    keepalive_timeout  65; 25    types_hash_max_size 2048; 26 27    include   /home/app/openresty/nginx/conf/vhosts/*.conf; 28    #gzip  on; 29}

    mkdir  vhosts
    cd vhosts
    vi xxx_admin.conf

1upstream gateway { 2    server xx.xx.xx.xxx:80xx; 3} 4server { 5    listen       8088; 6    server_name client.bbbbbb.com; 7    access_log logs/client.access.log main; 8    error_log  logs/client.error.log crit; 9    location / { 10        root   html; 11       # index  index.html index.htm; 12    } 13    location ^~/api { 14        proxy_set_header Host $host; 15        proxy_set_header X-Real-IP $remote_addr; 16        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 17        proxy_buffering off; 18        rewrite ^/api/(.*)$ /$1 break; 19        proxy_pass http://gateway; 20    } 21    error_page   500 502 503 504  /50x.html; 22    location = /50x.html { 23        root   html; 24    } 25}

5.启动nginx
    cd /home/app/openresty/nginx/sbin
    ./nginx

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )