ubuntu16.04安装nginx并支持https
1.ssh登录服务器
2.下载nginx安装文件: wget http://nginx.org/download/nginx-1.15.1.tar.gz
3.解压: tar -zxvf nginx-1.15.1.tar.gz
4.安装依赖:sudo apt-get update
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install libpcre3-dev
sudo apt-get install gcc
sudo apt-get install libpcre3 libpcre3-dev
5.进入解压后的文件夹:cd nginx-1.15.1
6.编译:./configure --with-http_ssl_module (如果不带上--with-http_ssl_module则不支持https)
7、sudo apt-get install git
8、下载subs_filter模块
cd /tmp
git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
9、./configure --with-http_ssl_module --with-http_sub_module --add-module=/tmp/ngx_http_substitutions_filter_module/
10.安装:make install (如果有错误 有可能是权限问题 试试使用sudo make install执行) 安装后的文件默认放在/usr/local/nginx/下面
11.测试: sudo ./nginx -v 显示版本
基本命令:
sudo ./nginx -t: 测试
sudo ./nginx -s reload: 重新载入配置文件(记住,修改了配置文件需要重新载入,不能直接reopen)
sudo ./nginx -s stop :停止
sudo ./ngxin -s reopen :重启

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· Vue3状态管理终极指南:Pinia保姆级教程
2017-11-01 java中如何根据函数查询引用的jar包