2

This is in continuation to the question, that I posted on SO yesterday. 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. After much trail and error, I finally managed to push the app and start it. But, when I try to open the web app. Bluemix throws me an error

403 Forbidden
   nginx 

If I understand correctly, this has something to do with permissions to access certain folder on my RoR app. 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?

Here is the link

EDIT :

This is my error log on ngnix folder on bluemix

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

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. It is created when i push my app to bluemix (Or am I missing something here?)

Community
  • 1
  • 1
Betafish
  • 1,212
  • 3
  • 20
  • 45

2 Answers2

0

You can not use the Nginx (static buildpack to serve your Ruby on Rails app. You must use the Ruby buildpack for that.

Jeff Sloyer
  • 4,899
  • 1
  • 24
  • 48
0

The problem was caused for two reasons (atleast in my scenario).

a) Not using the correct build pack. The one which solved my problem was using this buildpack from CF

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

b) Sensitivity of the manifest file - Bluemix started throwing the following error:

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).

Betafish
  • 1,212
  • 3
  • 20
  • 45