1、操作系统为Centos

2、导致无法访问是因为系统开启了selinux

3、关闭selinux


相关命令如下:

  • 临时关闭SELinux 
setenforce 0
  • 临时打开SELinux 
setenforce 1
  • 查看SELinux状态 
getenforce
  • 开机关闭SELinux 
编辑/etc/selinux/config文件,如下图,将SELINUX的值设置为disabled。下次开机SELinux就不会启动了。 
nginx 启动后访问静态资源 permission deny 无法访问
注意,此时也不能通过setenforce 1命令临时打开。
[[email protected] ~]# setenforce 1setenforce: SELinux is disabled

需要修改配置文件,然后重启linux后,才可以再打开SELinux

将SELinux关闭后,表态资源正常访问

相关文章:

  • 2021-12-10
  • 2021-11-25
  • 2021-10-21
  • 2021-08-01
  • 2022-12-23
  • 2022-01-11
  • 2022-02-06
猜你喜欢
  • 2021-11-27
  • 2022-01-02
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2022-02-10
  • 2021-11-30
相关资源
相似解决方案