查看问题详情

编号项目分类查看权限最后更新
0000577Anolis OS 8* OTHERSpublic2021-12-10 14:42
报告员anolislw 分派给yunqi-zwt  
优先级normal严重性minor出现频率always
状态 assigned处理状况open 
平台x86_64操作系统Anolis OS操作系统版本8
标题0000577: [Anolis8.4-x86_64] 安装nginx:1.18页面访问403问题
描述[问题描述]:
Anolis8.4-x86_64安装nginx:1.18 浏览器页面访问403问题,

[环境详情]
[root@qibo-lest02 html]# cat /etc/os-release
NAME="Anolis OS"
VERSION="8.4"
ID="anolis"
ID_LIKE="rhel fedora centos"
VERSION_ID="8.4"
PLATFORM_ID="platform:an8"
PRETTY_NAME="Anolis OS 8.4"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"

[root@qibo-lest02 html]# arch
x86_64
[root@qibo-lest02 html]# uname -a
Linux qibo-lest02 4.19.91-24.8.an8.x86_64 #1 SMP Tue Aug 31 11:30:53 CST 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@qibo-lest02 html]# dnf module list | grep nginx
Warning: failed loading '/etc/yum.repos.d/nginx.repo', skipping.
nginx 1.14 [d] common [d] nginx webserver
nginx 1.16 common [d] nginx webserver
nginx 1.18 [e] common [d] [i] nginx webserver
[root@qibo-lest02 html]# nginx -v
nginx version: nginx/1.18.0

[问题分析]
index.html链接到不存在的文件导致(手动重建index.html,页面访问正常)

[root@qibo-lest02 html]# rpm -ql nginx | grep conf
/etc/nginx/fastcgi.conf
/etc/nginx/fastcgi.conf.default
/etc/nginx/nginx.conf
/etc/nginx/nginx.conf.default
[root@qibo-lest02 html]# rpm -ql nginx | grep nginx.conf
/etc/nginx/nginx.conf
/etc/nginx/nginx.conf.default
[root@qibo-lest02 html]# cat /etc/nginx/nginx.conf | grep root
        root /usr/share/nginx/html;
# root /usr/share/nginx/html;
[root@qibo-lest02 html]# ll /usr/share/nginx/html
total 16
-rw-r--r-- 1 root root 3896 Jul 21 15:31 404.html
-rw-r--r-- 1 root root 3946 Jul 21 15:31 50x.html
drwxr-xr-x 2 root root 4096 Nov 24 16:18 icons
lrwxrwxrwx 1 root root 25 Jul 21 15:33 index.html -> ../../testpage/index.html #出错位置
-rw-r--r-- 1 root root 368 Jul 21 15:31 nginx-logo.png
lrwxrwxrwx 1 root root 14 Jul 21 15:33 poweredby.png -> nginx-logo.png

[复现步骤]
dnf module install nginx:1.18 -y
systemctl start nginx
[root@qibo-lest02 html]# curl -I localhost:80 #或者浏览器输入:ip 访问
HTTP/1.1 403 Forbidden 0000403
Server: nginx/1.18.0
Date: Wed, 24 Nov 2021 08:40:43 GMT
Content-Type: text/html
Content-Length: 153
Connection: keep-alive

标签没加标签.

活动

anolislw

2021-11-24 16:41

报告者  

image.png (30,098 字节)   
image.png (30,098 字节)   

问题历史

日期 用户名 字段 更改
2021-11-24 16:41 anolislw 新建问题
2021-11-24 16:41 anolislw 添加了以下文件:: image.png
2021-12-10 14:42 jacobwang 分派给 => yunqi-zwt
2021-12-10 14:42 jacobwang 状态 新建 => 已分配
2021-12-10 14:42 jacobwang 描述已修改