質問するログイン新規登録

質問編集履歴

1

追記

2015/12/09 10:39

投稿

tixure55
tixure55

スコア400

title CHANGED
File without changes
body CHANGED
@@ -39,4 +39,50 @@
39
39
  上記nginx.confです。(便宜上PHPとしています。)rootのディレクトリのパーミッションは755になっているのですが、ブラウザ上で403 Forbidden
40
40
  nginx/1.8.0と表示されてしまいます。
41
41
 
42
- パーミッション以外の設定を見直す必要があるのでしょうか?
42
+ パーミッション以外の設定を見直す必要があるのでしょうか?
43
+
44
+ 追記:
45
+ 回答ありがとうございます。
46
+
47
+ 下記confでも同一状態になるので、locationディレクティブが原因ではないようです。
48
+ ```PHP
49
+ user nginx;
50
+ worker_processes 1;
51
+
52
+ error_log /var/log/nginx/error.log warn;
53
+ pid /var/run/nginx.pid;
54
+
55
+
56
+ events {
57
+ worker_connections 1024;
58
+ }
59
+
60
+
61
+ http {
62
+ server {
63
+ listen 8001;
64
+ server_name localhost;
65
+ root /var/www/ruby;
66
+ }
67
+
68
+
69
+ include /etc/nginx/mime.types;
70
+ default_type application/octet-stream;
71
+
72
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
73
+ '$status $body_bytes_sent "$http_referer" '
74
+ '"$http_user_agent" "$http_x_forwarded_for"';
75
+ access_log /var/log/nginx/access.log main;
76
+ sendfile on;
77
+ #tcp_nopush on;
78
+ keepalive_timeout 65;
79
+
80
+ #gzip on;
81
+ }
82
+
83
+ ```
84
+ /var/log/nginx/error.log ↓
85
+ ```PHP
86
+ 2015/12/09 19:36:12 [error] 9643#0: *1 directory index of "/var/www/ruby/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:8001"
87
+
88
+ ```