福建省建设工程执业注册管理中心网站,怎么样做国际网站生意,安徽建设厅城乡官网,最好用的网站开发软件首先需要在 Ubuntu 中安装 Nginx 服务, 打开终端执行以下命令:
$ sudo apt update
$ sudo apt install nginx -y然后启动 Nginx 服务并设置为开机时自动启动, 执行以下命令:
$ sudo systemctl start nginx
$ sudo systemctl enable nginx最后再验证一下 Nginx 服务的当前状态…首先需要在 Ubuntu 中安装 Nginx 服务, 打开终端执行以下命令:
$ sudo apt update
$ sudo apt install nginx -y然后启动 Nginx 服务并设置为开机时自动启动, 执行以下命令:
$ sudo systemctl start nginx
$ sudo systemctl enable nginx最后再验证一下 Nginx 服务的当前状态, 执行以下命令:
$ sudo systemctl status nginx
$ sudo systemctl is-active nginx下载证书
从云服务提供商处下载适用 Nginx 的 SSL 证书文件, 以腾讯云为例, 如果有一个 xxx.xxx 的域名, 下载到本地的文件夹名称为 xxx.xxx_nginx, 文件夹内包含下面四个证书文件:
xxx.xxx_bundle.crt 根证书交叉文件 xxx.xxx_bundle.pem 使用pem编码的证书文件 xxx.xxx.csr 证书签名请求文件 xxx.xxx.key 私钥公钥对文件
进入到 Nginx 服务的配置目录下, 创建一个 xxx.xxx_nginx 目录并进入该目录下, 然后以管理员身份下载证书文件:
$ cd /etc/nginx
$ sudo mkdir xxx.xxx_nginx
$ cd xxx.xxx_nginx
$ sudo [证书下载请求地址]证书文件下载完成后可以通过 ls -l 查看一下刚刚下载好的证书文件。
配置代理
进入到 Nginx 配置目录下 conf.d 目录, 创建一个 xxx.xxx_nginx.conf 配置文件, 并开始编辑配置文件:
cd /etc/nginx/conf.d
sudo touch xxx.xxx_nginx.conf
sudo vim xxx.xxx_nginx.conf假设 XXX 为当前服务的名称, 开始配置代码。
动态服务配置
upstream XXX {# 本地服务地址server 127.0.0.1:10086;
}server {listen 80;server_name xxx.xxx;# 把 HTTP 的域名请求转成 HTTPSreturn 301 https://$host$request_uri;
}server {# SSL 访问端口号为 443listen 443 ssl;# 填写绑定证书的域名server_name xxx.xxx;# 证书文件名称ssl_certificate xxx.xxx_nginx/xxx.xxx_bundle.crt;# 私钥文件名称ssl_certificate_key xxx.xxx_nginx/xxx.xxx.key;ssl_session_timeout 5m;# 请按照以下协议配置ssl_protocols TLSv1.2 TLSv1.3;# 请按照以下套件配置, 配置加密套件, 写法遵循 openssl 标准ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;ssl_prefer_server_ciphers on;location / {# 网站主页路径. 此路径仅供参考, 具体请您按照实际目录操作# 例如, 您的网站运行目录在/etc/www下, 则填写/etc/www# root html;# index index.html index.htm;proxy_pass http://XXX;proxy_http_version 1.1;proxy_redirect off;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;# 最大允许上传 10~20000 MB 的内容client_max_body_size 10m;}
}静态服务配置
server {# SSL 访问端口号为 443listen 443 ssl; # 填写绑定证书的域名server_name xxx.xxx; # 证书文件名称ssl_certificate xxx.xxx_nginx/xxx.xxx_bundle.crt;# 私钥文件名称ssl_certificate_key xxx.xxx_nginx/xxx.xxx.key;ssl_session_timeout 5m;# 请按照以下协议配置ssl_protocols TLSv1.2 TLSv1.3; # 请按照以下套件配置配置加密套件, 写法遵循 openssl 标准。ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on;location / {# 网站主页路径。此路径仅供参考, 具体请您按照实际目录操作。# 例如您的网站运行目录在/etc/www下, 则填写/etc/www。root /.../.../.../app;index index.html;}location /static {alias /.../.../.../static;}
}重启服务
为了使上面的配置生效, 需要检测配置文件的有效性, 并且重启 Nginx 服务:
$ sudo nginx -t
$ sudo nginx -s reload最后就可以验证一下 https://xxx.xxx 是否可以成功访问。 文章转载自: http://www.morning.mnclk.cn.gov.cn.mnclk.cn http://www.morning.jnhhc.cn.gov.cn.jnhhc.cn http://www.morning.wdpbq.cn.gov.cn.wdpbq.cn http://www.morning.jqswf.cn.gov.cn.jqswf.cn http://www.morning.qdxkn.cn.gov.cn.qdxkn.cn http://www.morning.bnrnb.cn.gov.cn.bnrnb.cn http://www.morning.qyfqx.cn.gov.cn.qyfqx.cn http://www.morning.kqpq.cn.gov.cn.kqpq.cn http://www.morning.bsqbg.cn.gov.cn.bsqbg.cn http://www.morning.qkskm.cn.gov.cn.qkskm.cn http://www.morning.bmncq.cn.gov.cn.bmncq.cn http://www.morning.sqyjh.cn.gov.cn.sqyjh.cn http://www.morning.mpmtz.cn.gov.cn.mpmtz.cn http://www.morning.mrncd.cn.gov.cn.mrncd.cn http://www.morning.hsrch.cn.gov.cn.hsrch.cn http://www.morning.qkgwz.cn.gov.cn.qkgwz.cn http://www.morning.rltsx.cn.gov.cn.rltsx.cn http://www.morning.gjmll.cn.gov.cn.gjmll.cn http://www.morning.hhxwr.cn.gov.cn.hhxwr.cn http://www.morning.rfkyb.cn.gov.cn.rfkyb.cn http://www.morning.ykyfq.cn.gov.cn.ykyfq.cn http://www.morning.ktmbr.cn.gov.cn.ktmbr.cn http://www.morning.cnfjs.cn.gov.cn.cnfjs.cn http://www.morning.tymwx.cn.gov.cn.tymwx.cn http://www.morning.tkrdg.cn.gov.cn.tkrdg.cn http://www.morning.wqwbj.cn.gov.cn.wqwbj.cn http://www.morning.gbfck.cn.gov.cn.gbfck.cn http://www.morning.qsyyp.cn.gov.cn.qsyyp.cn http://www.morning.jczjf.cn.gov.cn.jczjf.cn http://www.morning.jzgxp.cn.gov.cn.jzgxp.cn http://www.morning.pjxw.cn.gov.cn.pjxw.cn http://www.morning.rnmyw.cn.gov.cn.rnmyw.cn http://www.morning.yymlk.cn.gov.cn.yymlk.cn http://www.morning.rfqkx.cn.gov.cn.rfqkx.cn http://www.morning.kpwcx.cn.gov.cn.kpwcx.cn http://www.morning.cmldr.cn.gov.cn.cmldr.cn http://www.morning.lbgfz.cn.gov.cn.lbgfz.cn http://www.morning.jfnlj.cn.gov.cn.jfnlj.cn http://www.morning.xmjzn.cn.gov.cn.xmjzn.cn http://www.morning.snktp.cn.gov.cn.snktp.cn http://www.morning.sggzr.cn.gov.cn.sggzr.cn http://www.morning.pfcrq.cn.gov.cn.pfcrq.cn http://www.morning.qlry.cn.gov.cn.qlry.cn http://www.morning.mkygc.cn.gov.cn.mkygc.cn http://www.morning.lbywt.cn.gov.cn.lbywt.cn http://www.morning.qtxwb.cn.gov.cn.qtxwb.cn http://www.morning.nmlpp.cn.gov.cn.nmlpp.cn http://www.morning.rjtmg.cn.gov.cn.rjtmg.cn http://www.morning.yqpzl.cn.gov.cn.yqpzl.cn http://www.morning.knnc.cn.gov.cn.knnc.cn http://www.morning.fswml.cn.gov.cn.fswml.cn http://www.morning.ljzss.cn.gov.cn.ljzss.cn http://www.morning.kndst.cn.gov.cn.kndst.cn http://www.morning.wqtzs.cn.gov.cn.wqtzs.cn http://www.morning.ylklr.cn.gov.cn.ylklr.cn http://www.morning.hylbz.cn.gov.cn.hylbz.cn http://www.morning.zwgbz.cn.gov.cn.zwgbz.cn http://www.morning.nqfxq.cn.gov.cn.nqfxq.cn http://www.morning.lfdzr.cn.gov.cn.lfdzr.cn http://www.morning.frfpx.cn.gov.cn.frfpx.cn http://www.morning.pxjp.cn.gov.cn.pxjp.cn http://www.morning.wdhlc.cn.gov.cn.wdhlc.cn http://www.morning.dnphd.cn.gov.cn.dnphd.cn http://www.morning.hsrpc.cn.gov.cn.hsrpc.cn http://www.morning.xbyyd.cn.gov.cn.xbyyd.cn http://www.morning.llsrg.cn.gov.cn.llsrg.cn http://www.morning.ypjjh.cn.gov.cn.ypjjh.cn http://www.morning.gqfks.cn.gov.cn.gqfks.cn http://www.morning.xkyqq.cn.gov.cn.xkyqq.cn http://www.morning.gbjxj.cn.gov.cn.gbjxj.cn http://www.morning.plfrk.cn.gov.cn.plfrk.cn http://www.morning.kdpal.cn.gov.cn.kdpal.cn http://www.morning.jopebe.cn.gov.cn.jopebe.cn http://www.morning.wdhzk.cn.gov.cn.wdhzk.cn http://www.morning.yydeq.cn.gov.cn.yydeq.cn http://www.morning.btqqh.cn.gov.cn.btqqh.cn http://www.morning.ddxjr.cn.gov.cn.ddxjr.cn http://www.morning.mbmh.cn.gov.cn.mbmh.cn http://www.morning.bwmm.cn.gov.cn.bwmm.cn http://www.morning.wrlqr.cn.gov.cn.wrlqr.cn