0

I have a domain on namecheap and I created a subdomain for the staging env, nevertheless the point of me doing that because I want to have this domain to point to one page in my rails app but I'm not sure how to do that. so I went to staging and I nano the file in sites-enabled directive and added this block:

server {
  listen                8880;
  server_name           staging.my_domain_name.com;
  access_log        /var/www/my_app_name/current/log/access.log;
  error_log         /var/www/my_app_name/current/log/error.log;
  root              /var/www/my_app_name/current/public/;

  passenger_ruby /home/deploy/.rbenv/versions/2.1.0/bin/ruby;

  passenger_enabled           on;
  rails_env                   staging;
  rails_spawn_method          smart-lv2;
  passenger_min_instances     1;

  # Maintenance

  error_page 404 /404.html;
  error_page 403 /404.html;

  location = /404.html {
    internal;
  }
}

so for the root I tried to change the path to my view path

/var/www/my_app_name/current/app/views/pages/page_name.html.erb;

I also tried to add the link as it is I'm not sure how to do this and I'm still new in DevOps

I tried to look for how to make Nginx point to one page in my rails app

Note: It listens to 8880 because i have varnish server who listen to port 80

Any help would be highly appreciated. Thanks.

usmanali
  • 2,028
  • 2
  • 27
  • 38
MYounes
  • 1
  • 1
  • 2
  • If you are using 8880, you should also be using it in your url. Are you doing so? – usmanali Aug 25 '15 at 07:31
  • You can't point to `/var/www/my_app_name/current/app/views/pages/page_name.html.erb`, because it's .erb file. From Erb files Ruby\Rails generates HTML files. – 8f7ca04d817b1696 Aug 25 '15 at 07:55
  • Have you checked the `access.log` or `error.log`? What is their output? – usmanali Aug 25 '15 at 09:40
  • I also tried the solutions proposed in this link http://stackoverflow.com/questions/7027636/nginx-send-all-requests-to-a-single-html-page – MYounes Aug 25 '15 at 09:40

0 Answers0