常用脚本

2019-02-21  本文已影响0人  風過無痕_d1cc

*.nginx转发websocket请求配置方式

server {
    listen       32222;
    server_name  localhost;
    location / {
        proxy_pass http://10.168.31.224:32222;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
 }

代理服务器就可以转发224服务器的推送数据了。

*.centos7 防火墙命令

firewall-cmd --permanent --list-port //防火墙通过的端口
firewall-cmd --permanent --remove-port=48489/tcp //删除防火墙通过的端口
firewall-cmd --zone=public --add-port=26611/tcp --permanent ?//允许端口通过防火墙
firewall-cmd --reload //重新加载
systemctl stop firewalld.service //停止firewall
firewall-cmd --state //查看默认防火墙状态

*空间数据库postgis查询范围内点

    select * from p_alarm  where ST_dwithin(st_geomfromtext('POINT('||lon||' '||lat||')', 4326)::geography, st_geomfromtext('POINT(121.320498098192 31.0080137586396)', 4326)::geography,10000);

表示查询距离POINT(121.320498098192 31.0080137586396)点10000米内的点

上一篇 下一篇

猜你喜欢

热点阅读