首页 > 编程知识 正文

查看nginx是否启动,怎么重启nginx

时间:2023-05-05 05:27:21 阅读:40813 作者:1896

1、验证配置文件/usr/local/nginx/sbin/nginx-TC/usr/local/nginx/conf/nginx.conf/usr/local/nginx/nginx 指定local/nginx/conf/nginx.conf3,配置文件重新启动/usr/local/nginx/指定sbin的nginx.conf4. nginx配置ssl证书1 .购买和注册域名服务器(HTTPS配置需要ssl证书)2.购买ssl证书以推广Alibaba云(阿里巴巴云)证书,然后提供免费证书添加下载Nginx安全证书的http_ssl_module模块1.http _ SSL _ module (/usr/local/nginx/sbin/nginx-v ) 模块[ root @ lamb~] #/usr/local/nginx/sbin/nginx-vnginxversion 3360 nginx/1.15.8 builtbygcc4.8. 52015000 已安装biltwithopenssl1.0. 2k-FIPS 26 Jan 2017 tlssnisupportenabledconfigurearguments 3360-- prefix=/usr/local/nguments 检查已配置nginx -V的模块,然后复制并添加这些模块----prefix=/usr/local/nginx---with-http _ stub _ status _ moduls

4 .在源代码中运行(Nginx下载的目录为/home/tar/nginx-1.61 )./configure --prefix=/usr/local/nginx-- with-http _ stub _ status _ module-- with-http _ SSL _ module-- PID-path=/var/run/nginx/ngin access.log-- with-http _ gzip _ static 客户端----http-proxy-temp-path=/var/temp/nginx/proxy-- http-fastcgi-temp-path=/var/temp/nging scgi-- add-module=/home/tar/fast DFS-nginx-module/nginx-module否则,只使用make覆盖以前安装的nginx.以前好的usr/local/nginx/sbin/nginx.bak 7…备份新的nginx local/nginx/sbin/nginx“CP : cannotcreateregularfile ` 显示nginx’: textfile busy”时,建议使用local/nginx/sbin/nginx 5.验证和重新启动新工艺验证: [ root @ instance-qhno4n 00 nginx ] # nginx-ve nginx1. 16.1 builtbygcc8.4. 120200928 (red hat8.4.1-1) (gcc ) ) ) ) ) )。 built with OpenSSL1.1. 1g fi ps21 apr 2020 tlssnisupportenabledconfigurearguments 3360-- prefix=/usr/local/nginx-- with-http _ stub _ status _ module-- with-http _ SSL _ module-- PID-path=/var/run/nginx/ngin access.log-- with-http _ gzip _ static 客户端----http-proxy-temp-path=/var/temp/nginx/proxy-- http-fastcgi-temp-path=/var/temp/nging 下载类型为scgi-- add-module=/home/tar/fast DFS-nginx-module/nginx-module nginx的证书以配置nginx,并在http {}标记中添加443 ssl 与上面的80服务器并列,代码如下:服务器{ listen 443 SSL; server_name注册的域名client_max_body_size 60k; SSL _ certificate/mnt/install/SSL/5168840 _ demo2. dl djm.com _ nginx/5168840 _ demo2. dl djm.com.PEM; SSL _ certificate _ key/mnt/install/SSL/5168840 _ demo2. dl djm.com _ nginx/5168840 _ demo2. dl djm.com.kom ssl_session_timeout 5m; ssl_ciphers HIGH: aNULL: MD5; ssl_prefer_server_ciphers on; #前端页面location/{ root/mnt/install/dl djm-wx/dist/try _ files $ uri $ uri//index.html; index index.JSP index.htmlindex.htm; } #后台接口地址location/prod-API/{ proxy _ pass http://127.0.0.133607500/proxy _ connect _ time out 15s; proxy_send_timeout 15s; proxy_read_timeout 15s; proxy _ set _ headerx-real-IP $ remote _ addr; proxy _ set _ headerx-forwarded-for $ proxy _ add _ x _ forwarded _ for; }6.重新启动/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。