HuanMengAdmin/admin-server/MiaoYu.Api.Admin/wwwroot/docs/guide/hzy-admin/deployment/split.html
2024-07-18 02:27:50 +08:00

82 lines
27 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.62">
<style>
:root {
--c-bg: #fff;
}
html.dark {
--c-bg: #22272e;
}
html, body {
background-color: var(--c-bg);
}
</style>
<script>
const userMode = localStorage.getItem('vuepress-color-scheme');
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
document.documentElement.classList.toggle('dark', true);
}
</script>
<link rel="icon" href="/favicon.jpg"><title>前后端分离 | 您好, 欢迎查看 MiaoYu 文档 </title><meta name="description" content="MiaoYu 开源项目文档网站!">
<link rel="preload" href="/docs/assets/style-961b9d5d.css" as="style"><link rel="stylesheet" href="/docs/assets/style-961b9d5d.css">
<link rel="modulepreload" href="/docs/assets/app-4f4af2d5.js"><link rel="modulepreload" href="/docs/assets/split.html-e759ef21.js"><link rel="modulepreload" href="/docs/assets/split.html-7a328015.js"><link rel="modulepreload" href="/docs/assets/split-1-1db7d146.js"><link rel="prefetch" href="/docs/assets/index.html-28072875.js" as="script"><link rel="prefetch" href="/docs/assets/code-gen.html-4397c299.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-3fb3b3b2.js" as="script"><link rel="prefetch" href="/docs/assets/ioc-aop.html-0144cd72.js" as="script"><link rel="prefetch" href="/docs/assets/scheduled-tasks.html-bedcb769.js" as="script"><link rel="prefetch" href="/docs/assets/user-info.html-8578df40.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-013ddfd3.js" as="script"><link rel="prefetch" href="/docs/assets/dbs.html-9052a8ef.js" as="script"><link rel="prefetch" href="/docs/assets/efcore.html-ec28f7d0.js" as="script"><link rel="prefetch" href="/docs/assets/sql.html-fe3eac11.js" as="script"><link rel="prefetch" href="/docs/assets/work.html-fe7c2daa.js" as="script"><link rel="prefetch" href="/docs/assets/simple.html-54212753.js" as="script"><link rel="prefetch" href="/docs/assets/client.html-f2da1493.js" as="script"><link rel="prefetch" href="/docs/assets/download.html-903adac5.js" as="script"><link rel="prefetch" href="/docs/assets/problem.html-1c845052.js" as="script"><link rel="prefetch" href="/docs/assets/api.html-caba109f.js" as="script"><link rel="prefetch" href="/docs/assets/authorize.html-37a2ba6f.js" as="script"><link rel="prefetch" href="/docs/assets/data.html-578c517a.js" as="script"><link rel="prefetch" href="/docs/assets/api-check-model.html-b5cf845e.js" as="script"><link rel="prefetch" href="/docs/assets/api-resource-cache.html-f627996b.js" as="script"><link rel="prefetch" href="/docs/assets/api-result.html-f90b60b9.js" as="script"><link rel="prefetch" href="/docs/assets/request-limit.html-79d7eb18.js" as="script"><link rel="prefetch" href="/docs/assets/404.html-f9875e7b.js" as="script"><link rel="prefetch" href="/docs/assets/index.html-f24f1c0d.js" as="script"><link rel="prefetch" href="/docs/assets/code-gen.html-9aef4a31.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-287156bf.js" as="script"><link rel="prefetch" href="/docs/assets/ioc-aop.html-c387c913.js" as="script"><link rel="prefetch" href="/docs/assets/scheduled-tasks.html-b338f70f.js" as="script"><link rel="prefetch" href="/docs/assets/user-info.html-8f482e6a.js" as="script"><link rel="prefetch" href="/docs/assets/home.html-7cba3ecd.js" as="script"><link rel="prefetch" href="/docs/assets/dbs.html-4250b788.js" as="script"><link rel="prefetch" href="/docs/assets/efcore.html-c2834bdb.js" as="script"><link rel="prefetch" href="/docs/assets/sql.html-e0d45a22.js" as="script"><link rel="prefetch" href="/docs/assets/work.html-6d0ca231.js" as="script"><link rel="prefetch" href="/docs/assets/simple.html-80586b86.js" as="script"><link rel="prefetch" href="/docs/assets/client.html-0c7bcd45.js" as="script"><link rel="prefetch" href="/docs/assets/download.html-27f039c3.js" as="script"><link rel="prefetch" href="/docs/assets/problem.html-9ef68938.js" as="script"><link rel="prefetch" href="/docs/assets/api.html-8c3a828a.js" as="script"><link rel="prefetch" href="/docs/assets/authorize.html-be0e89f8.js" as="script"><link rel="prefetch" href="/docs/assets/data.html-0f889ade.js" as="script"><link rel="prefetch" href="/docs/assets/api-check-model.html-8aaab178.js" as="script"><link rel="prefetch" href="/docs/assets/api-resource-cache.html-465cb7e9.js" as="script"><link rel="prefetch" href="/docs/assets/api-result.html-f2682747.js" as="script"><link rel="prefetch" href="/docs/assets/request-limit.html-c85ce0aa.js" as="script"><link rel="prefetch" href="/docs/assets/404.html-ee2a0c1c.js" as="script">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/docs/" class=""><!----><span class="site-name">您好, 欢迎查看 MiaoYu 文档 </span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a class="external-link" href="https://www.bilibili.com/video/BV1tt4y157qH/" rel="noopener noreferrer" target="_blank" aria-label="视频讲解"><!--[--><!--]--> 视频讲解 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/docs/guide/others/home.md" class="" aria-label="其他项目"><!--[--><!--]--> 其他项目 <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="http://124.221.128.7:5600/" rel="noopener noreferrer" target="_blank" aria-label="HzyAdmin 预览"><!--[--><!--]--> HzyAdmin 预览 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://gitee.com/hzy6" rel="noopener noreferrer" target="_blank" aria-label="gitee"><!--[--><!--]--> gitee <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://github.com/hzy-6" rel="noopener noreferrer" target="_blank" aria-label="github"><!--[--><!--]--> github <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-color-mode-button" title="toggle color mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><a class="external-link" href="https://www.bilibili.com/video/BV1tt4y157qH/" rel="noopener noreferrer" target="_blank" aria-label="视频讲解"><!--[--><!--]--> 视频讲解 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/docs/guide/others/home.md" class="" aria-label="其他项目"><!--[--><!--]--> 其他项目 <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="http://124.221.128.7:5600/" rel="noopener noreferrer" target="_blank" aria-label="HzyAdmin 预览"><!--[--><!--]--> HzyAdmin 预览 <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://gitee.com/hzy6" rel="noopener noreferrer" target="_blank" aria-label="gitee"><!--[--><!--]--> gitee <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="https://github.com/hzy-6" rel="noopener noreferrer" target="_blank" aria-label="github"><!--[--><!--]--> github <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><a href="/docs/guide/hzy-admin/home.md" class="sidebar-item sidebar-heading active collapsible" aria-label="HzyAdmin"><!--[--><!--]--> HzyAdmin <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/home.md" class="sidebar-item" aria-label="欢迎使用"><!--[--><!--]--> 欢迎使用 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/user-info.md" class="sidebar-item" aria-label="获取登陆人信息"><!--[--><!--]--> 获取登陆人信息 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/scheduled-tasks.md" class="sidebar-item" aria-label="定时任务"><!--[--><!--]--> 定时任务 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/code-gen.md" class="sidebar-item" aria-label="代码生成"><!--[--><!--]--> 代码生成 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/ioc-aop.md" class="sidebar-item" aria-label="自动 IOC 注入 和 AOP"><!--[--><!--]--> 自动 IOC 注入 和 AOP <!--[--><!--]--></a><!----></li><li><p tabindex="0" class="sidebar-item collapsible">数据库 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/database/efcore.md" class="sidebar-item" aria-label="EFCore 初始化数据库"><!--[--><!--]--> EFCore 初始化数据库 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/database/sql.md" class="sidebar-item" aria-label="SQL 初始化数据库"><!--[--><!--]--> SQL 初始化数据库 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/database/dbs.md" class="sidebar-item" aria-label="多数据源"><!--[--><!--]--> 多数据源 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/database/work.md" class="sidebar-item" aria-label="事务,延迟提交"><!--[--><!--]--> 事务,延迟提交 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item active collapsible">部署 <span class="down arrow"></span></p><ul style="" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/deployment/split.md" class="sidebar-item active" aria-label="前后端分离部署"><!--[--><!--]--> 前后端分离部署 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/deployment/simple.md" class="sidebar-item" aria-label="整体部署"><!--[--><!--]--> 整体部署 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item collapsible">权限 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/permission/authorize.md" class="sidebar-item" aria-label="授权验证"><!--[--><!--]--> 授权验证 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/permission/data.md" class="sidebar-item" aria-label="数据权限"><!--[--><!--]--> 数据权限 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/permission/api.md" class="sidebar-item" aria-label="接口权限"><!--[--><!--]--> 接口权限 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item collapsible">WebApi <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/web-api/api-check-model.md" class="sidebar-item" aria-label="模型验证"><!--[--><!--]--> 模型验证 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/web-api/api-result.md" class="sidebar-item" aria-label="统一返回"><!--[--><!--]--> 统一返回 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/web-api/api-resource-cache.md" class="sidebar-item" aria-label="缓存特性"><!--[--><!--]--> 缓存特性 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/web-api/request-limit.md" class="sidebar-item" aria-label="限流特性"><!--[--><!--]--> 限流特性 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item collapsible">其他 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/hzy-admin/others/client.md" class="sidebar-item" aria-label="前端运行及说明"><!--[--><!--]--> 前端运行及说明 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/others/download.md" class="sidebar-item" aria-label="前端下载文件"><!--[--><!--]--> 前端下载文件 <!--[--><!--]--></a><!----></li><li><a href="/docs/guide/hzy-admin/others/problem.md" class="sidebar-item" aria-label="更多问题"><!--[--><!--]--> 更多问题 <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">其他项目 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/docs/guide/others/home.md" class="sidebar-item" aria-label="介绍"><!--[--><!--]--> 介绍 <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><!--]--><div><h1 id="前后端分离" tabindex="-1"><a class="header-anchor" href="#前后端分离" aria-hidden="true">#</a> 前后端分离</h1><div class="custom-container tip"><p class="custom-container-title">提示</p><p>项目采用的是前后端分离的模式开发,前端一般采用 nginx 部署 vue 代码</p></div><h2 id="_1、首先确认前端代码-打包基础目录是否正确" tabindex="-1"><a class="header-anchor" href="#_1、首先确认前端代码-打包基础目录是否正确" aria-hidden="true">#</a> 1、首先确认前端代码 打包基础目录是否正确</h2><blockquote><p>下图中 /client/ 代表打包后代码文件必须在一个 client 目录下</p></blockquote><p><img src="/docs/hzy-admin/deployment/split-1.jpg" alt="配置打包路径"></p><h2 id="_2、打包前端代码" tabindex="-1"><a class="header-anchor" href="#_2、打包前端代码" aria-hidden="true">#</a> 2、打包前端代码</h2><blockquote><p>打包后的前端代码,位于 dist 文件夹中</p></blockquote><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">npm</span> run build
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="_3、将打包后的代码放到-nginx-的-html-目录下" tabindex="-1"><a class="header-anchor" href="#_3、将打包后的代码放到-nginx-的-html-目录下" aria-hidden="true">#</a> 3、将打包后的代码放到 nginx 的 html 目录下</h2><blockquote><p>例如:/usr/local/nginx/html/client 这里的 client 目录根据你代码配置 /client/ 而定</p></blockquote><h2 id="_4、配置-nginx" tabindex="-1"><a class="header-anchor" href="#_4、配置-nginx" aria-hidden="true">#</a> 4、配置 nginx</h2><blockquote><p>下面是一个简单的 nginx 配置,如果你不会配置 nginx 请自行百度 或者 GPT</p></blockquote><div class="language-nginx line-numbers-mode" data-ext="nginx"><pre class="language-nginx"><code> <span class="token directive"><span class="token keyword">server</span></span> <span class="token punctuation">{</span>
<span class="token directive"><span class="token keyword">listen</span> <span class="token number">1088</span></span><span class="token punctuation">;</span><span class="token comment">#客户端访问端口</span>
<span class="token directive"><span class="token keyword">server_name</span> localhost</span><span class="token punctuation">;</span><span class="token comment">#客户端访问域名 Nginx服务器的地址</span>
<span class="token comment">#charset koi8-r;</span>
<span class="token comment">#access_log logs/host.access.log main;# </span>
<span class="token directive"><span class="token keyword">location</span> /</span> <span class="token punctuation">{</span>
<span class="token directive"><span class="token keyword">root</span> html</span><span class="token punctuation">;</span>
<span class="token directive"><span class="token keyword">index</span> index.html index.htm</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token comment">#error_page 404 /404.html;</span>
<span class="token comment"># redirect server error pages to the static page /50x.html</span>
<span class="token comment">#</span>
<span class="token directive"><span class="token keyword">error_page</span> <span class="token number">500</span> <span class="token number">502</span> <span class="token number">503</span> <span class="token number">504</span> /50x.html</span><span class="token punctuation">;</span>
<span class="token directive"><span class="token keyword">location</span> = /50x.html</span> <span class="token punctuation">{</span>
<span class="token directive"><span class="token keyword">root</span> html</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token comment"># proxy the PHP scripts to Apache listening on 127.0.0.1:80</span>
<span class="token comment">#</span>
<span class="token comment">#location ~ \.php$ {</span>
<span class="token comment"># proxy_pass http://127.0.0.1;</span>
<span class="token comment">#}</span>
<span class="token comment"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</span>
<span class="token comment">#</span>
<span class="token comment">#location ~ \.php$ {</span>
<span class="token comment"># root html;</span>
<span class="token comment"># fastcgi_pass 127.0.0.1:9000;</span>
<span class="token comment"># fastcgi_index index.php;</span>
<span class="token comment"># fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;</span>
<span class="token comment"># include fastcgi_params;</span>
<span class="token comment">#}</span>
<span class="token comment"># deny access to .htaccess files, if Apache&#39;s document root</span>
<span class="token comment"># concurs with nginx&#39;s one</span>
<span class="token comment">#</span>
<span class="token comment">#location ~ /\.ht {</span>
<span class="token comment"># deny all;</span>
<span class="token comment">#}</span>
<span class="token punctuation">}</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="_5、重启-nginx" tabindex="-1"><a class="header-anchor" href="#_5、重启-nginx" aria-hidden="true">#</a> 5、重启 nginx</h2><blockquote><p>重启 nginx 服务,访问 <a href="http://localhost:1088" target="_blank" rel="noopener noreferrer">http://localhost:1088<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 即可看到前端页面</p></blockquote><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">service</span> nginx restart
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></div><!--[--><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: 1396510655@qq.com">hzy</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script type="module" src="/docs/assets/app-4f4af2d5.js" defer></script>
</body>
</html>