我工作站上的多个虚拟主机,刚停止工作。将nginx
更新为v1.10.2并在Passenger
文件中添加新的locations.ini
nginx.conf
文件指针后,我发现403 Forbidden
个权限错误这些vhosts。不知道该看什么。
passenger_root /usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
但是,which ruby
:
/Users/rich/.rbenv/shims/ruby
所以我把指令改为上面的指令。重新启动nginx
,仍然相同。报告错误:
2017/10/23 19:51:36 [error] 10863#0: *61 directory index of "/Library/WebServer/Documents/alpha/public/" is forbidden, client: 127.0.0.1, server: alpha.local, request: "GET / HTTP/1.1", host: "alpha.local"
权限从未改变过。更不用说他们很放松(只有我看到):
drwxrwxrwx 20 rich admin 680B Jun 17 01:52 HQ
cd HQ:
drwxr-xr-x 8 rich admin 272B Jul 12 17:32 public
nginx.conf
:
user root admin;
worker_processes 8;
error_log /usr/local/var/log/error.log debug;
pid /usr/local/var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# index index.html index.erb;
access_log /usr/local/var/log/access.log;
passenger_root /usr/local/Cellar/passenger/5.1.11/libexec/src/ruby_supportlib/phusion_passenger/locations.ini;
passenger_ruby /Users/rich/.rbenv/shims/ruby;
passenger_friendly_error_pages on;
include /usr/local/etc/nginx/servers/*; # see below
}
server {
listen 80;
server_name alpha.local;
include /usr/local/etc/nginx/mime.types;
access_log /usr/local/var/log/access_alpha.log;
error_log /usr/local/var/log/error_alpha.log debug;
error_page 404 /404.html;
root /Library/WebServer/Documents/alpha/public;
passenger_enabled on;
passenger_base_uri /;
location / {
autoindex off;
# try_files $uri $uri/ /index.html?$query_string;
# index /;
# allow 192.168.1.0/24;
}
location = /img/favicon.ico { access_log off;}
}
nginx错误日志:
2017/10/24 15:35:39 [error] 10868#0: *86 directory index of "/Library/WebServer/Documents/alpha/public/" is forbidden, client: 127.0.0.1, server: alpha.local, request: "GET / HTTP/1.1", host: "alpha.local"
奇怪的东西。任何想法都赞赏如何正确地再次获得所有这些服务。似乎权限完全被取消了,我不确定它是否是nginx
更新。干杯
==============
更新2 :(更改了alpha / HQ)。此外,复制在一个完全独立的盒子上。自制程序更新,跳过nginx
对openssl
的依赖,希望更新到1.1版。我在那里发布了Github。虽然我没有证据,但这是我唯一的反馈显示非升级(仍然服务1.12.0而不是1.12.2)。所以我在想是的。
答案 0 :(得分:0)
固定。如果安装了Passenger
,则选择自制的问题,选择openssl
(openssl
,openssl@1.1
的版本。