
nginx
彭世瑜
要成为程序员的男人,个人主页:www.pengshiyu.com
-
原创 Linux环境编译安装Nginx
1、安装编译工具yum -y install make zlib zlib-devel gcc gcc-c++ libtool openssl openssl-devel pcre pcre-devel ncurses-devel perl2、创建用户groupadd wwwuseradd -g www www -M -s /sbin/nologin# -M参数表示不添加用户家目录,...2019-11-12 10:25:1469
0
-
原创 Nginx:root与alias的区别
root目录:root路径 + location路径alias别名:alias路径 替换 location路径例:location ^~ /dir/ { root /www/root/html/; # location = /www/root/html/ + /dir/}# 请求的URI: /dir/a.html时,返回 /www/root/html/dir/a....2019-10-29 19:51:3157
0
-
原创 Nginx http80,https443共存
配置如下server{ listen 80; listen 443 ssl; server_name www.iamle.com; index index.html index.htm index.php; root /home/wwwroot/www.iamle.com/; #ssl on; 这里要注释掉 ssl_certificate...2019-10-29 16:35:37465
0
-
原创 Linux:开启FTP传输文件
安装ftp服务# 检查是否安装vsftprpm -qa |grep vsftpd # 安装vsftpdyum install vsftpd -y # 启动服务service vsftpd start (启动)service vsftpd restart (重启)service vsftpd stop (停止)# 安装ftp客户端yum -y install ftp...2019-10-16 19:30:42289
0
-
原创 Nginx更新文件后不生效
问题描述Nginx更新网站文件后,重启Nginx发现静态部分没有更新,动态加载的内容已经更新了解决检查配置文件中看有没有类似 proxy_cache_path 的配置如果有就删除proxy_cache_path配置的目录下的所有文件eg:find /proxy/cache/path -type f -delete删除后刷新网站正常更新了参考Nginx缓存为什么清除不掉...2019-10-08 14:50:473918
0
-
原创 Nginx:配置HTTPS网址加上绿锁头
检查http_ssl_module 模块nginx 是否安装$ nginx -V出现 configure arguments: --with-http_ssl_module配置https和80端口配置基本相似,修改了端口和配置了sslserver { listen 443; #监听443端口(https默认端口) server_name www.xxx.c...2019-10-03 19:59:18212
0
-
原创 Nginx:不带www域名301重定向到www域名
server { listen 80; server_name example.org; return 301 http://www.example.org$request_uri;}server { listen 80; server_name www.example.org; ...}参考...2019-08-29 11:57:40230
0
-
原创 PHP:ThinkPHP5.0配置nginx
尝试了好多次,总算找到可以用的配置文件了,记录下server { listen 80; server_name thinkphp.lo; root /var/www; index index.html index.htm index.php; error_page 404 /404.html; locat...2019-03-12 18:07:321432
0
-
原创 Nginx的基本操作
基本操作1、启动$ nginx -c nginx.config-c 参数指定了要加载的nginx配置文件路径2、检查配置文件nginx -t或者nginx -t -c conf/nginx.conf 3、平滑重启nginx -s reload4、关闭nginx -s stopalias和root区别root和alias是系统文件路径的设置root 设置根目录...2018-12-28 22:39:45291
0
-
原创 python编程:linux环境gunicorn+nginx部署django项目
安装包pip install gunicorn supervisorgunicorn确保项目中有 wsgi.py 文件通过gunicorn启动django项目(project需要换为相应的名称)gunicorn --chdir project_dir --pythonpath venv/bin/python -w4 -b0.0.0.0:8090 project_name...2018-08-16 16:17:22579
0
-
原创 mac环境composer新建php的symfony项目并用nginx配置
本文使用的版本 PHP 5.5.36 symfony 2.8 composer 1.6.5关于安装symfony 2.8, 用官网的教程没有成功 https://github.com/symfony/symfony-installer 一直报错:curl: (35) Server aborted the SSL handshake采用composer成功了新建sy...2018-07-14 14:59:31493
0
-
原创 mac配置nginx和php-fpm
nginx和php-fpm关系:nginx把php代码转发给php-fpm服务解析nignx安装配置1、安装:brew install nginxmac环境brew安装nginx2、修改nginx配置文件/usr/local/var/wwwlocation ~ \.php$ { root /usr/local/var/ww...2018-07-14 11:24:456453
2
-
原创 mac环境brew安装nginx
以下是安装完成之后打印出来的提示信息Docroot is: /usr/local/var/wwwThe default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so thatnginx can run without sudo.nginx will load all files in /usr/loca...2018-07-10 11:04:32986
0