简体   繁体   English

403 Forbidden〜Nginx在Bluemix上

[英]403 Forbidden ~ nginx on Bluemix

This is in continuation to the question , that I posted on SO yesterday. 这是我昨天在SO上发布的问题的延续。 I am not sure if should make another questions or just link it to the older post. 我不确定是否应该提出其他问题,或者只是将其链接到旧帖子。

Neways, I have been trying to deploy ruby on rails app onto Bluemix. 一直以来,我一直在尝试将Rails应用程序上的ruby部署到Bluemix上。 After much trail and error, I finally managed to push the app and start it. 经过反复的尝试,我终于设法推动了应用程序并启动了它。 But, when I try to open the web app. 但是,当我尝试打开W​​eb应用程序时。 Bluemix throws me an error Bluemix抛出一个错误

403 Forbidden
   nginx 

If I understand correctly, this has something to do with permissions to access certain folder on my RoR app. 如果我理解正确,则与访问RoR应用程序中的某些文件夹的权限有关。 How to resolve this. 如何解决这个问题。 DO I have to change permission on my local app before pushing it to bluemix or is there something to be done on bluemix? 在将其推送到bluemix之前,我是否必须更改对本地应用程序的许可?或者在bluemix上需要做些什么?

Here is the link 这是链接

EDIT : 编辑:

This is my error log on ngnix folder on bluemix 这是我在bluemix上的ngnix文件夹上的错误日志

2015/07/23 10:16:39 [error] 37#0: *2 directory index of "/home/vcap/app/public/" is forbidden, client: 75.126.52.20, server: localhost, request: "GET / HTTP/1.1", host: "csw-events.mybluemix.net"

ngnix.conf file on bluemix Bluemix上的ngnix.conf文件

worker_processes 1;
daemon off;

error_log /home/vcap/app/nginx/logs/error.log;
events { worker_connections 1024; }

http {
  log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
  access_log /home/vcap/app/nginx/logs/access.log cloudfoundry;
  default_type application/octet-stream;
  include mime.types;
  sendfile on;

  gzip on;
  gzip_disable "msie6";
  gzip_comp_level 6;
  gzip_min_length 1100;
  gzip_buffers 16 8k;
  gzip_proxied any;
  gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;

  tcp_nopush on;
  keepalive_timeout 30;
  port_in_redirect off; # Ensure that redirects don't include the internal container PORT - 61596
  server_tokens off;

  server {
    listen 61596;
    server_name localhost;

    location / {
      root /home/vcap/app/public;
      index index.html index.htm Default.htm;

    }
  }
}

The ngix folder does not exist on my local system. ngix文件夹在我的本地系统上不存在。 It is created when i push my app to bluemix (Or am I missing something here?) 它在我将应用程序推送到bluemix时创建(或者我在这里缺少什么吗?)

您不能使用Nginx(静态buildpack来提供Ruby on Rails应用程序。必须为此使用Ruby buildpack。

The problem was caused for two reasons (atleast in my scenario). 造成此问题的原因有两个(在我的方案中至少是这样)。

a) Not using the correct build pack. a)没有使用正确的构建包。 The one which solved my problem was using this buildpack from CF 解决我问题的一个方法是使用CF中的这个buildpack

cf push csw-events -b https://github.com/cloudfoundry/ruby-buildpack.git

b) Sensitivity of the manifest file - Bluemix started throwing the following error: b)清单文件的敏感性-Bluemix开始引发以下错误:

FAILED 
Error reading manifest file: 
yaml: [] control characters are not allowed at line 1, column 1

This was resolved by downloading the manifest file again and replacing only specific part of it (like the command part). 通过再次下载清单文件并仅替换其中的特定部分(如命令部分)来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM