- server { listen 80; server_name example.org; return 301 http://www.example.org$request_uri; } server { listen 80; server_name www.example.org; ... } 123456789101112 参考 nginx 301 ... server { listen 80; server_name example.org; return 301 http://www.example.org$request_uri; } server { listen 80; server_name www.example.org; ... } 123456789101112 参考 nginx 301 ...
- 问题描述 Nginx更新网站文件后,重启Nginx发现静态部分没有更新,动态加载的内容已经更新了 解决 检查配置文件中看有没有类似 proxy_cache_path 的配置 如果有就删除proxy_cache_path配置的目录下的所有文件 eg: find /proxy/cache/path -type f -delete 1 删除后刷新网站正常更新了 ... 问题描述 Nginx更新网站文件后,重启Nginx发现静态部分没有更新,动态加载的内容已经更新了 解决 检查配置文件中看有没有类似 proxy_cache_path 的配置 如果有就删除proxy_cache_path配置的目录下的所有文件 eg: find /proxy/cache/path -type f -delete 1 删除后刷新网站正常更新了 ...
- 单个站点 配置如下 server { listen 80; server_name localhost; location / { root /app; index index.html; try_files $uri $uri/ /index.html; } } 1234567891011 其中: /app 是网站根目录 部署多个站点 server... 单个站点 配置如下 server { listen 80; server_name localhost; location / { root /app; index index.html; try_files $uri $uri/ /index.html; } } 1234567891011 其中: /app 是网站根目录 部署多个站点 server...
- Nginx通过OpenSSL配置Https及二级虚拟目录 1、创建私钥秘钥和证书 mkdir -p /usr/local/nginx/conf/ssl/ cd /usr/local/nginx/conf/ssl/ # 创建服务器私钥 openssl genrsa -des3 -out server.key 1024 # 创建签名请求的证书(CSR) openss... Nginx通过OpenSSL配置Https及二级虚拟目录 1、创建私钥秘钥和证书 mkdir -p /usr/local/nginx/conf/ssl/ cd /usr/local/nginx/conf/ssl/ # 创建服务器私钥 openssl genrsa -des3 -out server.key 1024 # 创建签名请求的证书(CSR) openss...
- 1、生成密码文件 # 安装工具包 yum install httpd-tools -y # 生成密码,用户名 admin, !如果再次执行会被覆盖 htpasswd -c /usr/local/nginx/.htpasswd admin # 提示输入2遍密码 1234567 2、nginx 配置 server { listen 8001; server_nam... 1、生成密码文件 # 安装工具包 yum install httpd-tools -y # 生成密码,用户名 admin, !如果再次执行会被覆盖 htpasswd -c /usr/local/nginx/.htpasswd admin # 提示输入2遍密码 1234567 2、nginx 配置 server { listen 8001; server_nam...
- 通过Nginx配置转发到Flask应用 server { listen 80; server_name _; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8000/; proxy_... 通过Nginx配置转发到Flask应用 server { listen 80; server_name _; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8000/; proxy_...
- 使用nginx+django部署项目的时候,为了提高加载速度,我将css,js,image等静态资源在nginx中配置了路径 本地测试没有问题,代码提交线上就出问题了,出现了这么个情况: css文件能加载但是没有生效 1 经过查找资料,大概从以下两个方面入手检查: 1、考虑css文件引用是否正确 2、考虑服务器nginx配置静态文件是否正确 打开浏览器cons... 使用nginx+django部署项目的时候,为了提高加载速度,我将css,js,image等静态资源在nginx中配置了路径 本地测试没有问题,代码提交线上就出问题了,出现了这么个情况: css文件能加载但是没有生效 1 经过查找资料,大概从以下两个方面入手检查: 1、考虑css文件引用是否正确 2、考虑服务器nginx配置静态文件是否正确 打开浏览器cons...
- 新部署一台机器,原样将nginx配置文件拷贝过去,一直报错 Bad Request (400) 1 经过多方查阅,折腾了一下午,总算找到答案了 我用的是Nginx + Gunicorn + Django + Supervisor 部署问题 最后发现问题出在了Django的配置文件上,需要再settings.py文件中增加允许域名 ALLOWED_HOSTS = ... 新部署一台机器,原样将nginx配置文件拷贝过去,一直报错 Bad Request (400) 1 经过多方查阅,折腾了一下午,总算找到答案了 我用的是Nginx + Gunicorn + Django + Supervisor 部署问题 最后发现问题出在了Django的配置文件上,需要再settings.py文件中增加允许域名 ALLOWED_HOSTS = ...
- 一、环境准备 使用express准备解析路径的应用 本来准备使用Flask, 不过没找到路由通配符的实现方法 1、server.js const express = require("express"); const app = express(); app.get("*", (request, response) => { response.send(... 一、环境准备 使用express准备解析路径的应用 本来准备使用Flask, 不过没找到路由通配符的实现方法 1、server.js const express = require("express"); const app = express(); app.get("*", (request, response) => { response.send(...
- 基本操作 1、启动 $ nginx -c nginx.config 1 -c 参数指定了要加载的nginx配置文件路径 2、检查配置文件 nginx -t 或者 nginx -t -c conf/nginx.conf 12345 3、平滑重启 nginx -s reload 1 4、关闭 nginx -s stop 1 alias和root区别... 基本操作 1、启动 $ nginx -c nginx.config 1 -c 参数指定了要加载的nginx配置文件路径 2、检查配置文件 nginx -t 或者 nginx -t -c conf/nginx.conf 12345 3、平滑重启 nginx -s reload 1 4、关闭 nginx -s stop 1 alias和root区别...
- root目录: root路径 + location路径 1 alias别名: alias路径 替换 location路径 1 例: location ^~ /dir/ { root /www/root/html/; # location = /www/root/html/ + /dir/ } # 请求的URI: /dir/a.html时,返回 /www/roo... root目录: root路径 + location路径 1 alias别名: alias路径 替换 location路径 1 例: location ^~ /dir/ { root /www/root/html/; # location = /www/root/html/ + /dir/ } # 请求的URI: /dir/a.html时,返回 /www/roo...
- 1、安装编译工具 yum -y install make zlib zlib-devel gcc gcc-c++ libtool openssl openssl-devel pcre pcre-devel ncurses-devel perl 1 2、创建用户 groupadd www useradd -g www www -M -s /sbin/nologin... 1、安装编译工具 yum -y install make zlib zlib-devel gcc gcc-c++ libtool openssl openssl-devel pcre pcre-devel ncurses-devel perl 1 2、创建用户 groupadd www useradd -g www www -M -s /sbin/nologin...
- nginx和fastcgi的通信方式有两种 1、TCP: # 1、nginx location ~ \.php$ { index index.php index.html index.htm; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } # 2、... nginx和fastcgi的通信方式有两种 1、TCP: # 1、nginx location ~ \.php$ { index index.php index.html index.htm; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } # 2、...
- 尝试了好多次,总算找到可以用的配置文件了,记录下 server { listen 80; server_name thinkphp.lo; root /var/www; index index.html index.htm index.php; error_page 404 /404.html; location = /404.html { return 404... 尝试了好多次,总算找到可以用的配置文件了,记录下 server { listen 80; server_name thinkphp.lo; root /var/www; index index.html index.htm index.php; error_page 404 /404.html; location = /404.html { return 404...
- 安装echo模块 brew install nginx-full --with-echo-module # 如果之前安装过nginx brew unlink nginx 1234 配置hosts文件 $ sudo vim /etc/hosts 127.0.0.1 www.demo.com 123 配置nginx server { listen 80; ... 安装echo模块 brew install nginx-full --with-echo-module # 如果之前安装过nginx brew unlink nginx 1234 配置hosts文件 $ sudo vim /etc/hosts 127.0.0.1 www.demo.com 123 配置nginx server { listen 80; ...
上滑加载中
推荐直播
-
华为云码道 × 仓颉编程:工程化AI编码探索2026/05/27 周三 19:00-21:00
刘俊杰-华为云仓颉语言专家/李炎-华为云码道技术专家/王智鹏-OpenCangjie开源社区发起人
本场直播围绕华为云仓颉语言与华为云码道的深度结合,展示华为云智能编程从零基础到高效落地的完整生态能力。以华为云码道为引擎,仓颉语言为载体,带给大家日常提效、趣味创新到极速量产的开发体验。
回顾中 -
一个AI团队帮你写代码:华为云码道Agent Space实战2026/06/25 周四 19:00-21:00
张翰文-华为云码道工程师/郭英旭-青软创新科技集团股份有限公司 软件架构师
本场直播聚焦华为云码道Agent Space两大模式:研发办公、代码开发,亲身体验从需求到代码的AI自动化能力。实操演示基于华为 CodeArts CLI,依托 OpenSpec 规格体系从零搭建业务项目。
回顾中
热门标签