首页 > 系统相关 >【运维】服务报错 403,nginx报错

【运维】服务报错 403,nginx报错

时间:2023-10-16 14:44:55浏览次数:23  
标签:运维 xxx nginx xx 报错 usr local

现象:

文件上传接口 报错403,其余接口正常;

经尝试,当文件较小时,上传成功;但是文件超过10k时,报错403

 

合理怀疑是ngnix 配置问题,查看nginx日志:

一般来说 /usr/local/nginx/logs 下存在日志;查看error.log 

2023/10/09 17:31:56 [crit] 113148#0: *37499 open() "/usr/local/nginx/client_body_temp/0000000292" failed (13: Permission denied), 
client: xxx.xx.xx.xxx, server: localhost, 

request: "POST/xxxxxxx /upload/1711312440346918912 HTTP/1.1", host: "xxx.xx.xx.xxx:8080", 

referrer: "http://xxx.xx.xx.xxx:8080/xxxxxx"



2023/10/09 17:31:56 [error] 113148#0: *37499 open() "/usr/local/nginx/html/50x.html" failed (13: Permission denied), 
client: xxx.xx.xx.xxx, server: localhost, 

request: "POST /xxxxxxx /upload/1711312440346918912 HTTP/1.1", host: "xxx.xx.xx.xxx:8080", 
referrer: "http://xxx.xx.xx.xxx:8080/xxxxxx"

 

错误日志如上

 

解决方案:

有日志可见为权限问题;

给日志中 报错的路径  "/usr/local/nginx/client_body_temp/  加上权限;

"sudo chmod -R777 /usr/local/nginx/client_body_temp/';

 

==================

 查询资料,也有通过修改用户权限解决问题:即在nginx.conf 文件中 增加 user root;

该属性只要在用超户启动时才会生效,

但是修改之后并不能解决问题,无效;

 

 

 

参考文章:

https://blog.csdn.net/cjxshiwo/article/details/132539535

 

标签:运维,xxx,nginx,xx,报错,usr,local
From: https://www.cnblogs.com/CccccNun/p/17762745.html

相关文章

  • 【运维】旧版服务重启失败,服务日志不显示
    现象:流水线服务显示启动成功,单实际上没启动成功;服务日志不打印,不报错;意味着服务没有启动成功; 那么就需要查看tomcat运行日志;1.首先找到该服务在服务器上的tomcat地址; 方案一:可以找到启动脚本,找到类似/app/apache-tomcat-8.5.81/webapps,说明jar包部署在该tomcat的路......
  • 报错:Could not resolve view with name 'xxx' in servlet with name 'dispatcherServl
    报错:Servlet.service()forservlet[dispatcherServlet]incontextwithpath[]threwexception[Couldnotresolveviewwithname'xxx'inservletwithname'dispatcherServlet']withrootcauseCouldnotresolveviewwithname'xxx&......
  • gorm 使用where in 条件查询时,使用uint8[] 类型报错的解决方案
    出现问题:在开发过程中,遇到这样一个问题,GORMModel如下:typeTeststruct{ ... cloumnTypeuint8`gorm:"notnull;default:0"`...}其中有一个类型字段,数据范围是1-10所以使用uint8字段来存储,在查询某些类型的数据时,使用了下面的查询语句varlist[]model.......
  • Nginx开机自启配置
    Nginx开机自启配置Nginx1.13安装位置/usr/local/nginx监听端口80配置文件地址/usr/local/nginx/conf/开机自启动切换到/lib/systemd/system/目录,创建nginx.service文件vimnginx.service#cd/lib/systemd/system/#vimnginx.service如下内容[Un......
  • nginx获取response的cookie
    location/xxxxx/{proxy_passhttp://abc.com/;proxy_redirect http://abc.com/ http://abc.com/xxxxx/;proxy_set_headerCookie$http_cookie;proxy_cookie_path//xxxxx/;add_headerSet-Cookie"cookie_name=$upstream......
  • nginx服务
    server{server_nameerp.shudou.cnlisten80;location/{proxy_passhttp://127.0.0.1:8069;}}server{server_nameshudou.cnwww.shudou.cnlisten80;charsetutf-8;location/{includeuwsgi_params;uwsgi_pas......
  • redis在添加键值时报错"(error) MOVED...."
    问题描述:redis在添加键值时报错"(error)MOVED....",如下所示:数据库:redis6.2.5架构:三主三从1、异常重现192.168.133.97:6001>setk1v1(error)MOVED12706192.168.133.99:6001--集群信息192.168.133.97:6001>clusternodesb98cc2012f531244c29e2633f3d40ffc0c8bb2711......
  • poi报错org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetExcepti
    场景使用poi时报错org.apache.poi.POIXMLException:java.lang.reflect.InvocationTargetException报错信息:org.apache.poi.POIXMLException:java.lang.reflect.InvocationTargetExceptionatorg.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory......
  • nbcio-boot升级到3.1后出现online表单新增报错       nbcio-boot升级springboot、
        nbcio-boot升级springboot、mybatis-plus和JSQLParser后出现新增online表单的时候报错,如下: 2023-08-1321:18:01.292[http-nio-8080-exec-12][1;31mERROR[0;39m[36mo.jeecg.common.exception.JeecgBootExceptionHandler:69[0;39m-Handlerdispatchfailed;neste......
  • 记录Orcad中报错和解决方法
    本章目的:使用Orcad画原理图总会遇到奇怪的报错,故整理总结 1、根本原因:有元器件没有编号;更新一下位号解决。提示➤ERROR(ORNET-1048):Designisnotannotated.ERROR(ORNET-1006): Netlist failed or may be unusable. 2、根本原因:DesignCache右键CleanupCache,和......