
nginx
raytol
想得多也要做的多,要想得到更多也得做的更多
展开
-
nginx的location、root、alias指令用法和区别
nginx指定文件路径有两种方式root和alias,指令的使用方法和作用域:[root]语法:root path默认值:root html配置段:http、server、location、if[alias]语法:alias path配置段:location区别root与alias主要区别在于nginx如何解释location后面的uri,这会使两者分别以不同的方式将请求映射...转载 2019-10-23 14:39:04 · 139 阅读 · 0 评论 -
在已经安装好的 Openresty上增加新模块(Nginx 的新增方式也一样)
当前场景openresty 源码的目录是 /openresty-1.15.8.2openresty 安装目录 /usr/local/openresty/安装模块需求:安装模块 ngx_slab_stat步骤一1、下载 tenginewget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz2、解压 tengine-2....原创 2019-09-26 23:26:46 · 3771 阅读 · 0 评论 -
ubantu18 使用certbot申请免费的ssl证书
安装步骤添加 certbot 库sudo add-apt-repository ppa:certbot/certbot更新包列表sudo apt-get update安装 certbotsudo apt-get install python-certbot-nginx申请 ssl 证书certbot --nginx --nginx-server-root=/home/dep...原创 2019-09-19 11:29:18 · 247 阅读 · 0 评论 -
nginx 重载配置、热部署、切割日志文件
查看在运行的 nginx 进程ps -ef | grep nginxroot 2566 1 0 12:45 ? 00:00:00 nginx: master process ./nginx -c /home/deployer/nginx/conf/nginx.confnobody 2567 2566 0 12:45 ? 00:00:...原创 2019-09-09 21:13:44 · 255 阅读 · 0 评论 -
源码编译安装Nginx
1、通过官网下载 nginxwget http://nginx.org/download/nginx-1.14.2.tar.gz2、解压tar -xf nginx-1.14.2.tar.gz进入解压后目录cd nginx-1.14.23、设置编译配置参数./configure --prefix=/home/deployer/nginx其中 --prefix 表示指定存放配置...原创 2019-09-08 16:34:43 · 200 阅读 · 0 评论 -
Nginx基本操作
启动 Nginxservice nginx start 停止 Nginxservice nginx stop 重启 Nginxservice nginx restart 平滑重启 Nginxservice nginxe reload启用 Nginx 开机启动systemctl enable nginx 禁用 Nginx 开机启动systemctl disable n...原创 2019-05-06 23:05:55 · 152 阅读 · 0 评论 -
nginx配置显示虚拟主机目录
整个虚拟主机开启目录显示location /{ autoindex on; autoindex_exact_size off; autoindex_localtime on; }给某个目录开启目录显示location /file/{ autoindex on; autoindex_exact_size ...原创 2019-01-21 17:34:58 · 1077 阅读 · 0 评论 -
通过配置Nginx来解决跨域
在进行前后分离开发的时候,由于给前端项目配置了域名 ATest.test, 给后端项目配置了域名 BTest.test。当在前端项目中(ATest.test)想通过 Ajax 获取后端项目中(BTest.test)的资源数据时就会出现跨域的问题。通过配置Nginx方向代理解决在 ATest.test.conf 中加入location /home/getData { proxy_pa...原创 2018-12-25 22:32:43 · 147 阅读 · 0 评论 -
网站启用 https 前需要做的事
1、确保不使用 https 能以 http 形式正常访问2、服务器需要开启 443 端口原创 2018-12-09 20:26:18 · 225 阅读 · 0 评论 -
nginx 简单使用
检查 nginx 配置文件是否有问题nginx -t原创 2018-10-15 15:27:37 · 146 阅读 · 0 评论