- 单个站点 配置如下 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; ...
- uWSGI简单理解为:Web服务器 安装模块 pip install uwsgi pip install uwsgitop # 监控模块12 uWSGI测试 # foobar.py def application(env, start_response): start_response('200 OK', [('Content-Type','text/html... uWSGI简单理解为:Web服务器 安装模块 pip install uwsgi pip install uwsgitop # 监控模块12 uWSGI测试 # foobar.py def application(env, start_response): start_response('200 OK', [('Content-Type','text/html...
- 目录 文章目录 目录 Nginx Nginx 的安装 Nginx 的基础配置 配置虚拟主机 配置反向代理 配置负载均衡 配置 HTTPS Nginx Nginx 是俄罗斯人 Igor Sysoev 开发的一个开源的、轻量级的、高性能的、高可靠的 Web 和反向代理服务器,同时也是一个 IMAP/POP3/... 目录 文章目录 目录 Nginx Nginx 的安装 Nginx 的基础配置 配置虚拟主机 配置反向代理 配置负载均衡 配置 HTTPS Nginx Nginx 是俄罗斯人 Igor Sysoev 开发的一个开源的、轻量级的、高性能的、高可靠的 Web 和反向代理服务器,同时也是一个 IMAP/POP3/...
上滑加载中
推荐直播
-
妙手轻取华为云上自动化部署
2025/05/28 周三 16:30-17:30
阿肯-华为云生态技术讲师
还在一直手动进行薛定谔式部署吗?想尝试自动化又怕搞不定?其实你只是不知道这有多简单。本节课掰开一个个细节理清楚。
回顾中 -
华为云软件开发生产线(CodeArts)4月新特性解读
2025/05/30 周五 16:30-17:30
Enki 华为云高级产品经理
不知道产品的最新特性?没法和产品团队建立直接的沟通?本期直播产品经理将为您解读华为云软件开发生产线4月发布的新特性,并在直播过程中为您答疑解惑。
回顾中
热门标签