# ngc **Repository Path**: qinsJs/ngc ## Basic Information - **Project Name**: ngc - **Description**: nginx config - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-28 - **Last Updated**: 2026-03-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ngc nginx config 统一个人项目部署使用 ## 部署形式 1、返回 index.html + 跨域 fc fed dist 放在 cdn,物理机只返回 inde.html fed 的 http 请求 通过 跨域形式 > 有一个缺点,需要两个 https 证书。 2、返回 index.html + 转发 fc fed dist 放在 cdn,物理机只返回 inde.html 对于 /api 请求转发至于 fc > 缺点 > > 1. 流量全部要到 物理机 > 2. 配置麻烦 > 但是只要一个证书,更新容易 ## Nginx 相关 Blog - [try_files](https://blog.csdn.net/wangjun5159/article/details/117958519) ## 部署 1. git clone 项目 - 修改配置文件中 $my_path 的值 2. 将 key 放入 ssl 目录 3. 将配置文件 copy 至 nginx 4. 重启 Nginx ## 自动域名 certbot 的自动域名放在 /etc/letsencrypt/live ## Nginx 相关 重启 nginx ```sh systemctl restart nginx # or /usr/sbin/nginx -s reload # 查看状态 systemctl status nginx ``` 查看错误 Log ```sh tail -f /var/log/nginx/error.log ``` 检查端口占用 ```sh netstat -anp | grep 端口号 ``` 检查 nginx 权限 ```sh ps -ef | grep nginx ``` ```sh cp -av no01basic.conf /etc/nginx/conf.d/ cp -av no02static.conf /etc/nginx/conf.d/ cp -av no03app.conf /etc/nginx/conf.d/ cp -av no99demo.conf /etc/nginx/conf.d/ cp -av t0project.conf /etc/nginx/conf.d/ cp -av t0demo.conf /etc/nginx/conf.d/ cp -av t0show.conf /etc/nginx/conf.d/ cp -av t0doc.conf /etc/nginx/conf.d/ cp -av wx.conf /etc/nginx/conf.d/ systemctl restart nginx ``` ```js axios .get("http://pm.zkkimg.com/wp-json/wp/v2/posts/8371") .then((response) => { this.post = response.data; }) .catch(console.log); ```