nginx 403 forbidden 二种原因

Nginx出现403 forbidden nginx出现403 forbidden一般都是权限的问题 可能出现此问题的原因: 一、由于启动用户和nginx工作用户不一致所致 1.1查看nginx的启动用户,发现是nobody,而为是用root启动的 命令:ps aux | grep “nginx: worker process” | awk’{print $1}’ 1.2将nginx.config的user改为和启动用户一致, 命令:vi conf/nginx.conf 二、缺少index.html或者index.php文件,就是配置文件中in 阅读详情
引起nginx 403 forbidden有二种原因,一是缺少索引文件,二权限问题。今天又遇到 了,顺便总结一下。
1,缺少index.html或者index.php文件
server {
listen 80;
server_name localhost;
index index.php index.html;
root /home/zhangy/www;
如果在/home/zhang/www下面没有index.php,index.html的时候,直接访问域名,找不到文件,会报403 forbidden。例如:你访问www.test.com而这个域名,对应的root指定的索引文件不存在。
2,权限问题
因为权限问题引起的403,个人觉得比较难查找,因为一时想不起
server {
listen 80;
server_name localhost;
index index.php index.html;
root /home/zhangy/www;
我把web目录放在用户的所属目录下面,nginx的启动用户默认是nginx的,所以对目录根本没有读的权限,这样就会报403错误了。这个时候,把web目录的权限改大,或者是把nginx的启动用户改成目录的所属用户,重起一下就能解决。
27

转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/apachenginx/1512.html
【板栗糖GIS】新装ArcGIS必调的12个隐藏设置——【效率翻倍指南】 本文详细介绍了新装ArcGIS后必调的12个隐藏设置,涵盖性能优化、路径管理、显示调校、工作流定制等方面,帮助用户显著提升GIS工作效率。从关闭后台地理处理到启用硬件加速,再到个性化快捷键配置,这些实用技巧能让ArcGIS运行更流畅,操作更便捷。 阅读详情

相关推荐

考完CAIE认证一年后,谈谈它对我的职业的真实影响(干货)

大门,让面试官愿意给你机会,但进门之后的发展,还得靠持续的学习和项目积累。说实话,当时的心态是“考都考了,总比闲着强”,对这张证书能带来什么实际价值,心里并没有底。这种广泛的生态认可,让这张证书的“流通性”变得很强——无论跳槽还是在原公司发展,它都是一个被市场验证过的能力证明。对我个人而言,虽然没跳槽,但在年度调薪和争取内部项目时,持证经历也成了一个有力的“加分项”。这种巨大的薪资差距,恰恰反映了市场对“能落地、懂技术”的深度人才的渴求。考完证后的这一年,我看到了两条清晰的职业发展路径在自己面前展开。

qq_16014487的博客 817

可以直接访问nginx代理的后端,vue访问接口403

会对前端带有referer的请求进行验证,会通过配置拦截请求,并返回403.针对这种情况,在校验规则里加上对应的ip就可以了。这个原因很多,这里仅记录其中一种。当nginx配置防盗链时,如下。

qq_43614242的博客 1341

kaggle竞赛平台上数据集下载详解

从kaggle 网站上下载数据集既保证了速度又避免了网络的不稳定造成下载失败问题。该平台也可以上传代码作为自己的代码库,不过本人更习惯将代码上传到github上。希望本人整理的kaggle库使用技巧能够帮助到正在阅读本博客的你。此外还有一篇博客针对kaggle数据集下载问题的几个问题的相关文章进行了整理【博客链接】。

li1784506的博客 2万+

部署vue项目到服务器时访问出现403权限不足

部署vue项目到服务器时访问出现403错误

Zwwxd666的博客 3953

Python-OpenCV及cv2,numpy库最新安装教程[最全步骤]

安装教程目录前言OpenCV-Python安装教程报错解决cv2安装numpy安装opencv安装(附加)总结 前言 首先,我知道一些看到我的Blog的人已经在网上找了很多歪路子,现在已经火冒三丈了(我也是这样过来的hhhh),那么现在,深呼吸,跟着我的教程,不要着急,每一步都要读一遍。完整安装过程需要1个小时左右(仅供参考,本人第一次安装python花了一天(确信)) OpenCV-Python...

qq_45425286的博客 7432

[统计模型] 基于R的潜在剖面分析(LPA)

本文主要介绍基于R进行潜在剖面分析(Latent Profile Aanalysis, LPA)。 关于潜在类别分析LCA/潜在剖面分析LPA的概念和区别,可以参考一下这篇文章: 潜在类别分析LCA \潜在剖面分析LPA介绍https://www.jianshu.com/p/4c830094131e?utm_campaign=maleskine 但是此文对潜类别分析的阐释还比较生涩,而且没有具体的代码编写、模型优选等内容。本文旨在丰富LPA的内容,并希望和大家交流、共同进步。 1. 什么是潜类别分.

bigstar863的博客 1万+

Nginx 出现403 Forbidden 的几种解决方案

一、启动用户和nginx工作用户不一致所致 1,查看nginx的启动用户: vi conf/nginx.conf 二、缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件。 server { listen 80; server_name localhost; index index............

weixin_44138647的博客 3万+

【Agent从入门到实践】40 容错优化:异常处理、重试机制、降级策略

各位小伙伴,咱们的多Agent框架一路优化到现在,决策快、执行效率高、资源用得省,看似啥都行,但只要一遇到网络波动、工具故障、数据异常调用web_search工具时网络超时,整个检索任务直接失败,写作Agent没数据可用向量库连接异常,向量检索直接崩掉,依赖检索结果的Agent全趴窝单个Agent执行出错,整个并行任务流程直接中断,前功尽弃高并发下部分工具调用失败,框架没有备用方案,只能返回任务失败说白了,咱们之前的框架只有正常执行逻辑,没有异常兜底逻辑。

人工智能AI技术 912

Nginx出现403错误,应该怎么解决

Nginx在实际工作中扮演了多重角色,包括Web服务器、反向代理服务器、负载均衡器、静态资源服务器、缓存服务器以及SSL/TLS终结点等。其高性能、可靠性和灵活性使得Nginx成为现代应用架构中不可或缺的组件,帮助提供高效、安全且可扩展的服务。

vivlol918的博客 1万+

2026年海能达嵌入式岗位面试题集(含参考答案)

本文总结了嵌入式系统开发中的常见面试题,涵盖项目经验、外设接口、存储系统、编程基础、操作系统等核心模块。主要内容包括:1)项目核心经历的硬件/软件架构及问题解决思路;2)SPI、I2C等接口协议的时序特点与应用要点;3)NAND Flash存储管理中的ECC校验原理和文件系统对接方案;4)USB设备枚举流程等关键知识点。这些题目针对嵌入式岗位的技术考察重点,既包含底层硬件接口细节,也涉及系统级设计与优化策略,全面考察开发者的嵌入式系统能力。

Open 362

【思考模型框架】采用双钻模型:发散(桌面研究/用户访谈)→收敛(需求归类/优先级排序),输出需求规格书、追踪矩阵及产品待办清单。

设计思维双钻模型是一种以用户为中心的需求管理方法,通过"发散-收敛"的双循环确保问题定位准确、方案切实可行。第一钻石(探索→定义)聚焦"找对问题",运用用户访谈、田野调查等方法挖掘真实需求;第二钻石(开发→交付)解决"做对方案",通过原型测试、A/B测试验证可行性。该模型强调低保真验证、多团队协作和真实用户测试,避免资源浪费与伪需求开发。典型应用场景包括产品功能优化、用户体验提升等需要精准落地的需求场景。核心价值在于建立从用户痛点到解决方案的可控闭

奶爸的编程之路,也就一周冷个三天 319

通过nginx配置Vue nginx报403问题的解决方法

今天在服务器上通过子目录部署vue build后的文件时,遇到了部署后访问该路径报403 Forbidden的问题。具体情况如下: nginx的版本为1.17.3 此时nginx.conf的配置情况 server { listen 5000; server_name localhost; ...

Magic1an的博客 1万+

Python爬虫实战:用Playwright+Transformer做财经新闻事件驱动分析,我靠它抓住了算力政策的涨停机会

对我来说,这套系统最大的价值不是抓住了几次涨停,而是把“看新闻→分析→决策”的全流程自动化、量化了——不用再被股吧的情绪带偏,不用再熬夜刷新闻,而是用数据和模型做理性判断。更重要的是,搭建这套系统的过程,我吃透了Playwright动态爬虫、Transformer文本分析、量化数据对接这些核心技能,这些技能不管是做量化、做数据分析师,还是做其他领域的爬虫,都能用得上。现在打开PyCharm,跟着代码跑一遍,你也能从海量财经新闻里,挖出属于自己的事件驱动信号——与其靠感觉炒股,不如靠数据说话。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1393

Nginx 403 forbidden 错误的原因及解决方法

Nginx 403 forbidden 错误的原因及解决方法 一、由于启动用户和nginx工作用户不一致所致 1.1查看nginx的启动用户,发现是nginx,而为是用root启动的 [root@iZwz96xkbmh1v1n08cvb5dZ /]# ps aux|grep nginx root 2773 0.0 0.0 9068 844 ? Ss 13:56 0:00 nginx: master process /usr/sbin/nginx nginx

qq_46087622的博客 5万+

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Nginx 403 forbidden错误的5种原因及解决方法

到此这篇关于Nginx 403 forbidden错误的五种原因及详细解决方法的文章就介绍到这了,更多微点阅读。

hdxx2022的博客 7278

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

nginx “403 Forbidden” 错误的原因及解决办法

nginx 的 403 Forbidden errors 表示你在请求一个资源文件但是nginx不允许你查看。 403 Forbidden 只是一个HTTP状态码,像404,200一样不是技术上的错误。 哪些场景需要返回403状态码的场景? 1.网站禁止特定的用户访问所有内容,例:网站屏蔽某个ip访问。 2.访问禁止目录浏览的目录,例:设置autoindex off后访问目录。

Anders的技术成长专栏 6万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

接口报错403 Forbidden 【已解决】

接口报错403 Forbidden 【已解决】

我是 二川兄,对Web开发、GIS开发、3D模型、机器学习、面试技巧等方面都有一些涉猎~ 欢迎您加入技术交流圈!你可以在我的文章末尾找到我~ 1万+

nginx出现403 forbidden错误的两种原因

引起Nginx 403 forbidden有二种原因,一是缺少索引文件,二权限问题。今天又遇到 了,顺便总结一下。如果在/home/zhang/www下面没有index.php,index.html的时候,直接访问域名,找不到文件,会报403 forbidden。例如:你访问www.test.com而这个域名,对应的root指定的索引文件不存在。因为权限问题引起的403,个人觉得比较难查找进行如下配置 我把web目录放在用户的所属目录下面,nginx的启动用户默认是nginx的,所以对目录根本没有读的权限

qq_23257451的博客 6516
上一篇: nginx,apache开启文件目录浏览功能
下一篇: MySQL修改root密码的多种方法
y_server
博客等级 码龄11年 6粉丝 11原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值