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

时间:2023-05-26 11:38:20

#!/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'