fix:Fix the incorrect path in the nginx configuration file.

Fix the incorrect path in the nginx configuration file.
Update the deployment documentation.
This commit is contained in:
david_bai
2025-07-23 23:48:28 +08:00
parent 7950aec063
commit bac5e84d90
3 changed files with 20 additions and 28 deletions
+2 -2
View File
@@ -82,7 +82,7 @@ configure_nginx() {
done < "$NGINX_TEMPLATE" > "$TEMP_NGINX"
# Copy the configuration file to the target location
cp "$TEMP_NGINX" /etc/nginx/sites-available/default
cp "$TEMP_NGINX" /etc/nginx/sites-enabled/default
# cp "$TEMP_NGINX" default_temp
rm "$TEMP_NGINX"
}
@@ -91,7 +91,7 @@ configure_nginx() {
configure_nginx
cp backend/docker/Nginx/nginx.conf /etc/nginx
echo "Nginx base configuration generated successfully at /etc/nginx/sites-available/default."
echo "Nginx base configuration generated successfully at /etc/nginx/sites-enabled/default."
echo "The script no longer restarts Nginx automatically."
echo ""
echo "NEXT STEP: Run Certbot to install the SSL certificate and automatically configure Nginx:"
+9 -13
View File
@@ -164,26 +164,22 @@ With the base Nginx configuration in place, we can now use Certbot to obtain and
Follow the on-screen prompts from Certbot (e.g., enter your email, agree to the ToS). Once complete, Certbot will automatically modify your Nginx configuration to enable HTTPS and reload the Nginx service.
Run the following command to check if the certificate path has been replaced:
```bash
sudo grep ssl_certificate /etc/nginx/sites-enabled/default
```
You should see a path pointing to `/etc/letsencrypt/live/privydrop.app/`
3. **Remove the redundant configuration generated by Certbot:**
```bash
sudo bash backend/docker/Nginx/del_redundant_cfg.sh
```
4. **Verification and Troubleshooting (Important):**
First, verify that the certificate path in your Nginx configuration has been updated automatically.
4. **start nginx:**
```bash
sudo grep ssl_certificate /etc/nginx/sites-available/default
```
You should see a path pointing to `/etc/letsencrypt/live/privydrop.app/`.
If, after running `certbot --nginx`, the path still points to the old placeholder, run the following command to force the certificate installation:
```bash
sudo certbot install --cert-name privydrop.app -d privydrop.app -d www.privydrop.app -d turn.privydrop.app
# Then, reload Nginx to apply the changes
sudo systemctl reload nginx
```
+9 -13
View File
@@ -164,26 +164,22 @@ cd backend && npm run build && cd ..
按照 Certbot 的提示操作(例如输入邮箱、同意服务条款等)。
运行如下命令,查看证书路径是否已替换:
```bash
sudo grep ssl_certificate /etc/nginx/sites-enabled/default
```
应该能看到指向 `/etc/letsencrypt/live/privydrop.app/` 的路径
3. **删除由 Certbot 产生的多余配置:**
```bash
sudo bash backend/docker/Nginx/del_redundant_cfg.sh
```
4. **验证与排错 (重要):**
首先,验证 Nginx 配置文件中的证书路径是否已自动更新。
4. **启动 nginx 服务:**
```bash
sudo grep ssl_certificate /etc/nginx/sites-available/default
```
正常情况下,您应该能看到指向 `/etc/letsencrypt/live/privydrop.app/` 的路径。
如果 `certbot --nginx` 执行后,上述路径依然是旧的占位符路径,请运行以下命令强制更新证书:
```bash
sudo certbot install --cert-name privydrop.app -d privydrop.app -d www.privydrop.app -d turn.privydrop.app
# 然后重载 Nginx 使之生效
sudo systemctl reload nginx
```