[TOC]
```
server {
listen 80;
server_name noval.wmlzy.cn;
root /www/noval_admin/public;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
location ~ \.php(.*)$ {
root /www/noval_admin/public;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#nginx支持tp
fastcgi_param PATH_INFO $1;
include fastcgi_params;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
}
```
* 添加 ssl 證書
以下代碼添加到 index index.php index.html index.htm; 下面 具體配置 可申請證書的時候查看
~~~
ssl_certificate_key /usr/local/nginx/cert/zy.wmlzy.cn.key;
ssl_certificate /usr/local/nginx/cert/zy.wmlzy.cn_bundle.crt;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
~~~
* 默認跳轉到 https 在配置最下面加上
~~~
server {
listen 80;
server_name zy.wmlzy.cn;
rewrite ^(.*)$ https://$host$1 permanent;
}
~~~

```
server {
listen 80;
listen 443 ssl http2;
server_name ~^([a-zA-Z0-9]+)-api-cmv2\.test\.pjpfljcw\.com$;
set $userName $1;
include all_ssl_params;
index index.html index.htm index.php index.shtml;
root /home/$userName/www/api-cmv2/;
error_log /data/wwwlogs/all-api-cmv2.error_nginx.log error;
access_log /data/wwwlogs/all-api-cmv2.access_nginx.log ;
index index.php;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
# proxy_pass http://127.0.0.1:18787;
proxy_pass http://unix:/tmp/$userName-api-cmv2.sock;
}
}
}
```
### 模糊匹配
```
server {
listen 80;
listen 443 ssl http2;
server_name ~^([a-zA-Z0-9]+)-api-cmv2\.test\.pjpfljcw\.com$;
set $userName $1;
include all_ssl_params;
index index.html index.htm index.php index.shtml;
root /home/$userName/www/api-cmv2/;
error_log /data/wwwlogs/all-api-cmv2.error_nginx.log error;
access_log /data/wwwlogs/all-api-cmv2.access_nginx.log ;
index index.php;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
# proxy_pass http://127.0.0.1:18787;
proxy_pass http://unix:/tmp/$userName-api-cmv2.sock;
}
}
}
```
```
server {
listen 80;
listen 443 ssl http2;
server_name ~^([a-zA-Z0-9]+)-((h5|admin)-[a-zA-Z0-9]+)\.test\.pjpfljcw\.com$;
set $userName $1;
set $projectHome $2;
include all_ssl_params;
index index.html index.htm index.php index.shtml;
root /home/$userName/www/$projectHome;
error_log /data/wwwlogs/all-h5.error_nginx.log error;
access_log /data/wwwlogs/all-h5.access_nginx.log ;
location / {
try_files $uri $uri/ /index.html;
}
}
```
server {
listen 80;
listen 443 ssl http2;
server_name ~^([a-zA-Z0-9]+)-api-hf\.test\.pjpfljcw\.com$;
set $userName $1;
include all_ssl_params;
index index.html index.htm index.php index.shtml;
root /home/$userName/www/api-hf/;
error_log /data/wwwlogs/wumengliang-api-hf.error_nginx.log error;
access_log /data/wwwlogs/wumengliang-api-hf.access_nginx.log ;
index index.php;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
# proxy_pass http://127.0.0.1:18787;
proxy_pass http://unix:/home/wumengliang/www/api-hf/runtime/http.sock;
}
}
}
```
```
- 文檔說明
- 開始
- linux
- 常用命令
- ps -ef
- lsof
- netstat
- 解壓縮
- 復制
- 權限
- 其他
- lnmp集成安裝
- supervisor
- 安裝
- supervisor進程管理
- nginx
- 域名映射
- 負載均衡配置
- lnmp集成環境安裝
- nginx源碼安裝
- location匹配
- 限流配置
- 日志配置
- 重定向配置
- 壓縮策略
- nginx 正/反向代理
- HTTPS配置
- mysql
- navicat創建索引
- 設置外網鏈接mysql
- navicat破解
- sql語句學習
- 新建mysql用戶并賦予權限
- php
- opcache
- 設計模式
- 在CentOS下安裝crontab服務
- composer
- 基礎
- 常用的包
- guzzle
- 二維碼
- 公共方法
- 敏感詞過濾
- IP訪問頻次限制
- CURL
- 支付
- 常用遞歸
- 數據排序
- 圖片相關操作
- 權重分配
- 毫秒時間戳
- base64<=>圖片
- 身份證號分析
- 手機號相關操作
- 項目搭建 公共處理函數
- JWT
- 系統函數
- json_encode / json_decode 相關
- 數字計算
- 數組排序
- php8
- jit特性
- php8源碼編譯安裝
- laravel框架
- 常用artisan命令
- 常用查詢
- 模型關聯
- 創建公共方法
- 圖片上傳
- 中間件
- 路由配置
- jwt
- 隊列
- 定時任務
- 日志模塊
- laravel+swoole基本使用
- 拓展庫
- 請求接口log
- laravel_octane
- 微信開發
- token配置驗證
- easywechart 獲取用戶信息
- 三方包
- webman
- win下熱更新代碼
- 使用laravel db listen 監聽sql語句
- guzzle
- 使用workman的httpCLient
- 修改隊列后代碼不生效
- workman
- 安裝與使用
- websocket
- eleticsearch
- php-es 安裝配置
- hyperf
- 熱更新
- 安裝報錯
- swoole
- 安裝
- win安裝swoole-cli
- google登錄
- golang
- 文檔地址
- 標準庫
- time
- 數據類型
- 基本數據類型
- 復合數據類型
- 協程&管道
- 協程基本使用
- 讀寫鎖 RWMutex
- 互斥鎖Mutex
- 管道的基本使用
- 管道select多路復用
- 協程加管道
- beego
- gin
- 安裝
- 熱更新
- 路由
- 中間件
- 控制器
- 模型
- 配置文件/conf
- gorm
- 初始化
- 控制器 模型查詢封裝
- 添加
- 修改
- 刪除
- 聯表查詢
- 環境搭建
- Windows
- linux
- 全局異常捕捉
- javascript
- 常用函數
- vue
- vue-cli
- 生產環境 開發環境配置
- 組件通信
- 組件之間通信
- 父傳子
- 子傳父
- provide->inject (非父子)
- 引用元素和組件
- vue-原始寫法
- template基本用法
- vue3+ts項目搭建
- vue3引入element-plus
- axios 封裝網絡請求
- computed 計算屬性
- watch 監聽
- 使用@符 代替文件引入路徑
- vue開發中常用的插件
- vue 富文本編輯
- nuxt
- 學習筆記
- 新建項目踩坑整理
- css
- flex布局
- flex PC端基本布局
- flex 移動端基本布局
- 常用css屬性
- 盒子模型與定位
- 小說分屏顯示
- git
- 基本命令
- fetch
- 常用命令
- 每次都需要驗證
- git pull 有沖突時
- .gitignore 修改后不生效
- 原理解析
- tcp與udp詳解
- TCP三次握手四次揮手
- 緩存雪崩 穿透 更新詳解
- 內存泄漏-內存溢出
- php_fpm fast_cgi cig
- redis
- 相關三方文章
- API對外接口文檔示范
- elaticsearch
- 全文檢索
- 簡介
- 安裝
- kibana
- 核心概念 索引 映射 文檔
- 高級查詢 Query DSL
- 索引原理
- 分詞器
- 過濾查詢
- 聚合查詢
- 整合應用
- 集群
- docker
- docker 簡介
- docker 安裝
- docker 常用命令
- image 鏡像命令
- Contrainer 容器命令
- docker-compose
- redis 相關
- 客戶端安裝
- Linux 環境下安裝
- uni
- http請求封裝
- ios打包
- 視頻縱向播放
- 日記
- 工作日記
- 情感日志
- 壓測
- ab
- ui
- thorui
- 開發規范
- 前端
- 后端
- 狀態碼
- 開發小組未來規劃