nginx

 

查找nginx安装的路径以及相关安装操作命令 

1、查看nginx安装目录

输入命令

# ps  -ef | grep nginx

返回结果包含安装目录

root      2662     1  0 07:12 ?        00:00:00 nginx: master process /usr/sbin/nginx

2、查看nginx.conf配置文件目录

输入命令

# nginx -t

 

检查是否已经安装有nginx及对应目录:
find /|grep nginx.conf

还可以用以下两个命令,找安装的路径
[root@localhost ~]# netstat -tnlp|grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 21196/nginx: master
然后看到一行记录,复制最后的一个数据(进程ID)
ps -aux |grep 进程ID
就可以看到nginx的启动方式了。

xxiu'g

查看服务器上安装的nginx版本号,主要是通过ngix的-v或-V选项
Linux下查看Nginx安装目录、版本号信息?
-v 显示 nginx 的版本。
-V 显示 nginx 的版本,编译器版本和配置参数。
[root@localhost ~]# /usr/sbin/nginx -v
 

===================================
查看linux系统版本命令
[root@localhost ~]# cat /proc/version
Linux version 4.1.5-x86_64-linode61 (maker@build) (gcc version 4.7.2 (Debian 4.7.2-5) ) #7 SMP Mon Aug 24 13:46:31 EDT 2015
[root@localhost ~]# cat /etc/redhat-release

 

CentOS 下安装nginx:
centos7系统库中默认是没有nginx的rpm包的,所以我们自己需要先更新下rpm依赖库
(1)使用yum安装nginx需要包括Nginx的库,安装Nginx的库
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm包的安装:
1.安装一个包
# rpm -ivh
2.升级一个包,没安装过的不能使用升级命令
# rpm -Uvh
3.移走一个包
# rpm -e

安装准备依赖lib库
yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

(2)使用下面命令安装nginx
#yum install nginx

(3)启动Nginx
#service nginx start

#systemctl start nginx.service
(4)重启nginx
service nginx restart

https://www.cnblogs.com/qianjilou/p/9550639.html

端口占用:netstat -ltunp   nltp

 

 

nginx默认上传最大值是1M

在nginx.conf中添加配置client_max_body_size即可,如下上传最大为20M 

 

 

       location /pieai/message/ {
              
                      proxy_pass http://127.0.0.1:8125/pieai/message/;
                      proxy_set_header  X-Real-IP  $remote_addr;
                      proxy_set_header Cookie $http_cookie;
                      proxy_cookie_domain domino.server nginx.server;
            proxy_http_version 1.1; 
            proxy_connect_timeout 4s; 
            proxy_read_timeout 3600s; 
            proxy_send_timeout 12s; 
            proxy_set_header Upgrade $http_upgrade; 
            proxy_set_header Connection "Upgrade"; 
      } 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值