原文:https://www.cnblogs.com/wuling129/p/5039978.htmlhtml
證書過時 ,更新證書,記錄下nginx
yum -y install gcc gcc-c++ autoconf
yum -y install openssl openssl-develc++
寶塔Nginx配置文件目錄vim
/www/server/nginx/conf/nginx.conf
/www/server/panel/vhost/nginx/你的域名.conf
常見路徑centos
# vim /etc/nginx/conf.d/default 或 vim /etc/nginx/conf.d/example_ssl.conf安全
個人路徑session
個人是 /usr/local/nginx/extra ,目錄下是www.xx.com.conf 、m.xx.com_ssl.conf ,還存在m.xx.com.conf (不起做用的文件),我不知道這個是根據什麼配置的,高手路過請指教下tcp
vim退出保存:按Esc,按:wq 網站
配置示例spa
# HTTPS server # server { listen 443 ; server_name localhost; ssl on; ssl_certificate /etc/nginx/ssl/xx.com.crt; ssl_certificate_key /etc/nginx/ssl/xx.com.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { root /usr/share/nginx/html; index index.html index.htm; } }
/etc/init.d/nginx restart
nginx http跳轉到https
server { listen 80; server_name test.com; ........ rewrite ^(.*)$ https://$host$1 permanent; #添加這行強制跳轉 ...... }
在網站-設置-SSL,而後輸入key和pem就好,很是簡單
而後,在安全裏面添加443端口 (必定要檢查下一步,否則都訪問不了網站)
原文:https://blog.csdn.net/jiankunking/article/details/71077059
查看開放端口
iptables -L -n
新增開放端口 :
//開放8080端口 iptables -I IN_public_allow -p tcp --dport 8080 -j ACCEPT iptables -I INPUT -p tcp --dport 8080-j ACCEPT
相關文章推薦: