1. 程式人生 > >shell讀取nginx配置文件中nginx的端口

shell讀取nginx配置文件中nginx的端口

count 文件中 onf pri ace stat class pac lis

#!/bin/sh
port=`nl /usr/local/openresty/nginx/conf/nginx.conf | sed -n ‘/listen/p‘ | awk ‘NR==1{print $3}‘ | sed ‘s/;//g‘`

curl -g http://127.0.0.1:${port}/dsideal_yy/space/lean_stat/save_stat
curl -g http://127.0.0.1:${port}/dsideal_yy/space/class_record/timer_count_data

# 判斷一下是不是https開啟

nl /usr/local/openresty/nginx/conf/nginx.conf | sed -n ‘/listen/p‘ | sed -n ‘/443/p‘

shell讀取nginx配置文件中nginx的端口