安装nginx

从阿里云服务器下载 nginx版本的ssl证书,防止再 /etc/nginx/ssl 下

停止 nginx 服务

systemctl stop nginx

修改配置文件 /etc/nginx/conf.d

[root@izm5ej17n8ygrf4cd27m36z nginx]# cat nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf; events {
worker_connections 1024;
} http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048; include /etc/nginx/mime.types;
default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf; server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html; # Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf; location / {
} error_page 404 /404.html;
location = /40x.html {
} error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
} server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name www.renyimao.cn; // 指定证书的域名
root /usr/share/nginx/html; ssl_certificate "/etc/nginx/ssl/2833975_www.renyimao.cn.pem"; // 公钥
ssl_certificate_key "/etc/nginx/ssl/2833975_www.renyimao.cn.key"; // 私钥
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on; # Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf; location / {
} error_page 404 /404.html;
location = /40x.html {
} error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
} }

重启服务

systemctl restart nginx

访问域名

最新文章

  1. ZOJ Problem Set - 1350 The Drunk Jailer ac代码 memset
  2. mysql复制一列到另一列
  3. Android中的onActivityResult和setResult方法的使用
  4. 分享50款 Android 移动应用程序图标【下篇】
  5. There is no Action mapped for action name XXX. - [unknown location]
  6. Ember.js demo2
  7. 使用ProcDump在程序没有响应时自动收集dump
  8. Walking Ant(一道有意思的蚂蚁游戏,bfs)
  9. 使用HTML DOM 来分配事件 —— onmouseover和onmouseout ,onmousedown和onmouseup
  10. MongoDB --- 01. 安装, 第三方客户端
  11. 本地yum仓库搭建,使用163yum源
  12. QT4.8.6-VS2010开发环境配置
  13. RabbitMQ TroubleShooting
  14. 论文笔记:A Review on Deep Learning Techniques Applied to Semantic Segmentation
  15. Re:从零开始的Spring Session(二)
  16. 开发一个简单的babel插件
  17. 洛谷.3381.[模板]最小费用最大流(zkw)
  18. RobotFramework安装指南
  19. 实现ListView的加载更多的效果,如何将按钮布局到始终在ListView的最后一行
  20. 手机访问本地php项目遇到的问题及解决

热门文章

  1. Python语言程序设计(3)--字符串类型及操作--time库进度条
  2. 关于vue的v-for遍历不显示问题
  3. pycharm激活2018(终极解决办法)
  4. HBASE-LSM树(转载)
  5. 干货 | 10分钟教你用column generation求解vehicle routing problems
  6. mysql 创建时间字段
  7. Cloudera-Manager(一) —— 基本概念及使用
  8. 统一异常处理@ControllerAdvice
  9. GD-GAN: Generative Adversarial Networks for Trajectory Prediction and Group Detection in Crowds
  10. MySQL事务隔离级别(一)