在使用 service nginx status 命令查看 nginx 的运行状态时,提示:Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory 导致 nginx 服务关闭,服务不可用 Read More
posted @ 2021-03-10 23:26
范丰平
Views(7956)
Comments(0)
Diggs(1)
在 nginx 的配置文件 nginx.conf 中添加如下配置 server { listen 8080; server_name localhost; location /shanghai { proxy_pass http://www.shanghai.gov.cn/; } location Read More
posted @ 2021-03-10 23:10
范丰平
Views(311)
Comments(0)
Diggs(0)
创建如下所示的目录,并在相应的文件中写入相应的内容,简单模拟三个不同的服务 在 Nginx 的配置文件中添加所示的代理配置 server { listen 8081; server_name localhost; location / { root /data/servers/8081; index Read More
posted @ 2021-03-10 23:08
范丰平
Views(404)
Comments(0)
Diggs(0)
Lua 脚本在 Nginx 中基本的使用方式有三种:指令方式、脚本文件、函数(语句块)方式,相应的简单示例源码如下所示: # 使用 Lua 指令方式 location /lua_command { default_type 'text/plain'; content_by_lua 'ngx.say( Read More
posted @ 2021-03-10 23:07
范丰平
Views(292)
Comments(0)
Diggs(0)
在 /etc/bashrc 或 ~/.bashrc 中添加如下所示的环境变量配置 export NGINX_HOME=/opt/work/nginx export PATH=$NGINX_HOME/sbin: 然后使用 source 命令使配置生效 # 对所有用户生效 source /etc/bas Read More
posted @ 2021-03-10 23:05
范丰平
Views(338)
Comments(0)
Diggs(0)
从 Nginx 的官网获取 nginx 的默认启动配置初始脚本,如下所示,并保存为 /etc/init.d/nginx #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 Read More
posted @ 2021-03-10 23:04
范丰平
Views(115)
Comments(0)
Diggs(0)
话不多说,简单安装脚本源码如下所示: #!/bin/bash # Author : Fan Fengping # Date : 2021-03-10 export SOF_PWD=`pwd` export NGX_HOM='/data/servers/nginx' export LUA_JIT='L Read More
posted @ 2021-03-10 23:03
范丰平
Views(127)
Comments(0)
Diggs(0)
Centos Shell 安装后启动时提示找不到 lua 模块的 libluajit-5.1.so.2 文件,具体提示信息:./nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared ob Read More
posted @ 2021-03-10 23:02
范丰平
Views(3555)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号