centos7 ngix操作命令

测试不通过
• 阅读 1908
启动、停止nginx
cd /usr/local/nginx/sbin/
./nginx 
./nginx -s stop
./nginx -s quit
./nginx -s reload
开启反向代理权限
sudo setsebool httpd_can_network_connect 1

设置https

1 添加https模块 
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module
2.覆盖配置文件 
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 
3.配置
        # HTTPS server
#
server {
   listen 80 default backlog=2048;
   listen       443 ssl;
   server_name  stoge.cn;

   ssl_certificate      cert.pem;
   ssl_certificate_key  cert.key;

   ssl_session_cache    shared:SSL:1m;
   ssl_session_timeout  5m;

   ssl_ciphers  HIGH:!aNULL:!MD5;
   ssl_prefer_server_ciphers  on;

    location / {   
    }
    }
点赞
收藏
评论区
推荐文章
芝士年糕 芝士年糕
2年前
nginx 启动、停止、关闭
使用3A服务器搭建的centos系统安装nginx教程在我的往期博客中1,nginx指定配置文件/usr/local/nginx/sbin/nginxc/usr/local/nginx/conf/nginx.conf1c参数指定了要加载的nginx配置文件路径1,从容停止Nginx:killQUIT主进程号2,快速停止Nginx:kil
芝士年糕 芝士年糕
2年前
完全卸载nginx及安装的详细步骤
前言在开局配置Nginx时有可能会配置错误,报各种错误代码。看不懂或者懒得去看这个报错时,其实最简单的方式是卸载并重装咯。今天就带大家一起学习下,如何彻底卸载nginx程序。一、卸载NGINX卸载nginx程序的详细步骤1、停止Nginx软件/usr/local/nginx/sbin/nginxsstop如果不知道nginx安装路径,可以通过执行ps命
Stella981 Stella981
3年前
Nginx配置https
一、开启nginx的ssl模块1.未安装过nginx,编译安装配置参数如下:./configure\prefix/usr/local/nginx\withpcre\withhttp\_ssl\_modulessl模块\withhttp\_stub\_status\_module\wit
Stella981 Stella981
3年前
CentOS 7设置开机启动服务,添加自定义系统服务
CentOS7设置开机启动服务建立服务文件保存目录设置开机自启动其他命令1.建立服务文件文件路径vim/usr/lib/systemd/system/nginx.service服务文件内容1.ngin
Wesley13 Wesley13
3年前
LNMP架构之访问日志、日志切割、静态文件不记录及过期时间设置
本文索引:Nginx访问日志Nginx日志切割静态文件不记录日志和过期时间Nginx访问日志修改nginx配置文件root@localhostvhostvim/usr/local/nginx/conf/nginx.conf搜索:/log_format
Stella981 Stella981
3年前
Nginx的反向调度功能
1.案例实现Nginx反向代理;2.反向代理的理论知识拓展.一,实验Nginx的反向代理功能 使用Nginx实现Web反向代理功能,实现如下功能:后端Web服务器两台,可以使用httpd实现Nginx采用轮询的方式调用后端Web服务器两台Web服务器的权重要求设置为不同的值最大失败次数为1,失败超时时间为
Stella981 Stella981
3年前
Nginx 启动、停止、平滑重启和平滑升级 graceful shutdown of worker processes
Controllingnginxhttp://nginx.org/en/docs/control.htmlnginxcanbecontrolledwithsignals.TheprocessIDofthemasterprocessiswrittentothefile/usr/local/nginx/logs/ngi
Stella981 Stella981
3年前
Nginx之使用nginx搭建简单的文件服务器
  使用nginx可以搭建简单文件服务器  安装nginx(不详述)    修改配置文件/usr/local/nginx/conf/nginx.confuserroot;worker_processes1;error_loglogs/error.log;pidlog
Wesley13 Wesley13
3年前
2018.9.20笔记
Nginx默认虚拟主机去掉usr/local/nginx/conf/nginx.conf中的内容Server{.....}vim/usr/local/nginx/conf/nginx.conf//增加includevhost/.conf;
Stella981 Stella981
3年前
Linux常用软件启动、停止、重启命令
一、PHP启动命令:/usr/local/php5/sbin/phpfpm停止命令:pkillphpfpm二、MySQL启动命令:/etc/init.d/mysqldstart停止命令:/etc/init.d/mysqldstop重启命令:/etc/
Stella981 Stella981
3年前
Linux——nginx(以Ubuntu为例,不同系统也就安装和配置文件的的位置不一样,其他都一样的)
下载安装下载:猛击这里(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fpan.baidu.com%2Fs%2F1jIY49kM)安装:1、进入nginx目录执行:$./configureprefix/usr/local/nginxwith