Nginx 仅为 Sinatra 应用程序提供静态文件

Nginx only serving static files for a Sinatra application

我正在尝试 运行 ruby (sinatra) Nginx 下的脚本。 我的文件夹结构是:

/www (775)
/www/public (775)
/www/public/img.jpg (644)
/www/app.rb (775)
/www/index.html (775)

我的nginx.conf是:

worker_processes  1;
events {
  worker_connections  1024;
}

http {
  passenger_root /home/my_user/.rvm/gems/ruby-2.4.1/gems/passenger-5.1.6;
  passenger_ruby /home/my_user/.rvm/gems/ruby-2.4.1/wrappers/ruby;

  include       mime.types;
  default_type  application/octet-stream;
  sendfile        on;

  server {
    listen       80;
    server_name  xxx.xxx.xx.xx;

    root /www/public;
    passenger_enabled on;
  }
}

但我得到的只是 xxx.xxx.xx.xx/img.jpg,没有脚本。
xxx.xxx.xx.xx/index.html 给我错误 404 而 xxx.xxx.xx.xx 给出我又是错误 403。

在哪个用户是 nginx 服务器 运行ning 下很重要(文件夹 /www 和里面的文件有一个不同于用户 运行ning 的用户nginx).

谢谢

多亏了@tadman 开启了配置,问题只是缺少 config.ru 文件。