nginx 安装、配置 http + https 访问 tomcat 项目以及配置 http 强转 https

一、在 linux (CentOS)上安装 nginx

第一步:添加 nginx 存储库

xshell> yum install epel-release

第二步:安装 nginx

xshell> yum install nginx

使用 yum 安装 nginx 后,nginx 的默认路径为:/etc/nginx


第三步:启动 nginx

xshell> systemctl start nginx
如果你正在运行防火墙,请运行以下命令以允许 HTTP 和 HTTPS 通信:
xshell> firewall-cmd --permanent --zone=public --add-service=http 
xshell> firewall-cmd --permanent --zone=public --add-service=https
xshell> firewall-cmd --reload

第四步:访问 nginx 以验证安装是否成功

由于 nginx 默认的端口号为 80 ,直接在浏览器上输入你的 ip 地址 +80 端口号(例如:111.111.111.111:80),能够访问到 

nginx 的页面即表示 nginx 已经安装成功。类似于下图。

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值