跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[问与答] nginx 部署静态网站提示 403 错误

发表于

我在 Github Action 中用 rsync 通过 ssh 部署了生成的静态网站到我的 VPS 上,并用 nginx 做了发布,但是访问时提示 403 错误,log 日志如下:

2024/07/22 15:40:09 [error] 68243#68243: *7557 "/home/*****/data/blog-data/index.html" is forbidden (13: Permission denied), client: ***.***.**.**, server: blog.com, request: "GET / HTTP/1.1", host: "blog.com"

我尝试根据 GPT4o 给的解决方案,将改目录用户组改为了 www-root 但是依旧 403 错误。

也尝试过以下操作,也依旧 403 。

# 设置目录权限为 755  
find /home/*****/data/blog-data -type d -exec chmod 755 {} \;  

# 设置文件权限为 644  
find /home/*****/data/blog-data -type f -exec chmod 644 {} \;  

nginx 配置文件如下:

server {
    listen              443 ssl;  
    server_name         1900.live;
    
    include snippets/ssl-params.conf;

    location / {
        root /home/****/data/blog-data;
        index index.html;
    }



    location ~ /.well-known {
        allow all;
    }
  

    client_max_body_size 50m;
}

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.