unicornとnginxの設定をし
ドメインにアクセスすると403が返ってきました。
nginxのエラーログを確認すると
scan.error.logに下記が出力されました。
権限?が原因なようなのですが、どうすれば解決できるでしょうか?
/var/log/nginx/scan.error.log 2018/11/13 16:22:28 [error] 4054#0: *22 open() "/home/hoge/app/meraki_scanning_api/public/50x.html" failed (13: Permission denied), client: 210.146.152.152, server: [ホスト名], request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/home/hoge/app/meraki_scanning_api/tmp/unicorn.sock/favicon.ico", host: "ホスト名"
nginxの設定は下記のようになっています
nginx.conf server { listen 80; server_name [ホスト名]; root /home/hoge/app/meraki_scanning_api/public; access_log /var/log/nginx/scan.access.log main; error_log /var/log/nginx/scan.error.log; location / { # if static files don't exist, proxy it to Unicorn. if ( !-f $request_filename) { proxy_pass http://unicorn_server; } } # redirect server error pages to the static page /40x.html # error_page 404 /404.html; location = /40x.html { } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { } }
###試したこと
下記curlでアクセスすると下記結果が返ってきました。
curl localhost:80
html
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 3 <head> 4 <title>Test Page for the Nginx HTTP Server on the Amazon Linux AMI</title> 5 ・ 6 ・ 7 </div> 8 </body> 9</html>
しかし、ドメイン名からcurlすると403返ってきます。
curl ドメイン名:80
html
1<html> 2<head><title>403 Forbidden</title></head> 3<body bgcolor="white"> 4<center><h1>403 Forbidden</h1></center> 5<hr><center>nginx/1.12.1</center> 6</body> 7</html> 8