我有 nginx 通过 unix 套接字将请求转发到 gunicorn /run/gunicorn/socket
。默认情况下,SELinux 不允许这种行为:
grep nginx /var/log/audit/audit.log
type=SERVICE_START msg=audit(1454358912.455:5390): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nginx comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=AVC msg=audit(1454360194.623:7324): avc: denied { write } for pid=9128 comm="nginx" name="socket" dev="tmpfs" ino=76151 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=sock_file
type=SYSCALL msg=audit(1454360194.623:7324): arch=c000003e syscall=42 success=no exit=-13 a0=c a1=1f6fe58 a2=6e a3=7ffee1da5710 items=0 ppid=9127 pid=9128 auid=4294967295 uid=995 gid=993 euid=995 suid=995 fsuid=995 egid=993 sgid=993 fsgid=993 tty=(none) ses=4294967295 comm="nginx" exe="/usr/sbin/nginx" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1454361591.701:13343): avc: denied { connectto } for pid=9128 comm="nginx" …
Run Code Online (Sandbox Code Playgroud) 有一次,我住在一个有 6 间卧室的房子里,每间卧室都连接了 6 类以太网。连接到距离电缆调制解调器最远的卧室的互联网连接性能很差,但我不记得确切的症状是什么。最终我们发现问题是由于使用金属订书钉来固定整个房子的电缆。我搜索并发现了一些警告不要使用金属进行以太网电缆紧固的说明,但没有解释原因。为什么金属紧固件会如此影响性能?