前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >nginx permission root

nginx permission root

作者头像
pydata
发布2018-08-02 11:38:00
5190
发布2018-08-02 11:38:00
举报
文章被收录于专栏:pydata
nginx 权限问题的解决方法

按照下面方法配置nginx时出现用户权限问题

代码语言:javascript
复制
	server{
	listen 4002;
	server_name localhost;
	access_log logs/access.log;
	location / {
	   proxy_set_header X-Real-IP $remote_addr;
	   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	   proxy_set_header Host $http_host;
	   proxy_set_header X-NginxX-Proxy true;
	   proxy_pass http://backend;
	   proxy_redirect off;	   
	   proxy_http_version 1.1;
	   proxy_set_header Upgrade $http_upgrade;
	   proxy_set_header Connection "upgrade";
	   }
	   }
	 upstream backend {
	 server 127.0.0.1:3201;
	 }

参照nginx 13:permission denied solved The root directive is the problem here. Quote from the doc: note: Keep in mind that the root will still append the directory to the request so that a request for “/i/top.gif” will not look in “/spool/w3/top.gif” like might happen in an Apache-like alias configuration where the location match itself is dropped. Use the alias directive to achieve the Apache-like functionality. Basically, only use root for real roots: if the content is to be at / use root. If it’s going to end on a subfolder, use alias:

代码语言:javascript
复制
location  /map/ {
  alias  /home/user/public_html/map/;
}   Also check what user nginx is running as and make sure that this user can access /home/user/public_html/map
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2013年09月18日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • nginx 权限问题的解决方法
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档