项目部署在/tmp目录,nginx找不到文件

项目部署在/tmp目录导致nginx返回404错误,由于nginx的PrivateTmp配置默认为TRUE,创建了新的mount namespace,使得进程无法访问到实际的/tmp文件。解决方案是修改nginx.service中的PrivateTmp为false或更改项目部署目录,并重启nginx。
摘要由CSDN通过智能技术生成

blog部署在/tmp目录下,导致网页一直报404错误

原因是nginx的配置中PrivateTmp值默认为TRUE。当这个值设置了true,进程启动时/tmp会挂载一个全新的mount namespace,可以理解成每个进程看到的都是全新的空的/tmp。

 

PrivateTmp=
Takes a boolean argument. If true, sets up a new file system namespace for the executed processes and mounts private /tmp and /var/tmp directories inside it that is
not shared by processes outside of the namespace. This is useful to secure access to
temporary files of the process, but makes sharing between processes via /tmp or /var/tmp impossible. If this is enabled, all temporary files created by a service in
these directories will be removed after the service is stopped. Defaults to false. It
is possible to run two or more units within the same private /tmp and /var/tmp namespace by using the JoinsNamespaceOf= directive, see system
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值