ruby on rails - Downloading text instead of render (probably Nginx conf) -


i'm trying deploy app vps (rails 3.2, capistrano 2.15)

ubuntu 13.10 + nginx 1.4.7 + phusion passenger 4.0.40

i following these manuals

http://gorails.com/deploy/ubuntu/12.04 , https://library.linode.com/web-servers/nginx/configuration/basic

had problems in configuring nginx never used before (403 err, 500 err etc)

eventually got weird thing makes me nuts: when go url app supposed (and normal html page supposed rendered) text file downloaded instead. text file contains ruby code (like in code of /home/myapp/current/app/views/home/index.html.haml).

here /opt/nginx/conf/nginx.conf contains

#user  nobody; worker_processes  1;  error_log  logs/error.log; #error_log  logs/error.log  notice; #error_log  logs/error.log  info;  #pid        logs/nginx.pid;   events { worker_connections  1024; }   http {     passenger_root /home/myapp/.rvm/gems/ruby-2.0.0-p451/gems/passenger-4$     passenger_ruby /home/myapp/.rvm/gems/ruby-2.0.0-p451/wrappers/ruby;     include       mime.types; default_type  application/octet-stream;  #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ' #                  '$status $body_bytes_sent "$http_referer" ' #                  '"$http_user_agent" "$http_x_forwarded_for"';  # access_log  logs/access.log main;  sendfile        on; #tcp_nopush     on;  #keepalive_timeout  0; keepalive_timeout  65;  #gzip  on;  server {     listen       111.111.111.111:80;     server_name  myserver.linode.com www.myserver.linode.com     rails_env production;     root /home/myapp/current/app/views/home;     passenger_enabled on;     error_page  404              /404.html;     index   index.html index.htm index.html.haml;     charset utf-8;     #}      # deny access .htaccess files, if apache's document root     # concurs nginx's 1     #     #location ~ /\.ht {     #    deny  all;     #}   # virtual host using mix of ip-, name-, , port-based configuration # #server { #    listen       8000; #    listen       somename:8080; #    server_name  somename  alias  another.alias;  #    location / { #        root   html; #        index  index.html index.htm; #    } #}  # https server # #server { #    listen       443; #    server_name  localhost;  #    ssl                  on; #    ssl_certificate      cert.pem; #    ssl_certificate_key  cert.key;  #    ssl_session_timeout  5m;  #    ssl_protocols  sslv2 sslv3 tlsv1; #    ssl_ciphers  high:!anull:!md5; #    ssl_prefer_server_ciphers   on;  #    location / { #        root   html; #        index  index.html index.htm; #    }     } } 

i tried remove line default_type application/octet-stream; , after code of /home/myapp/current/app/views/home/index.html.haml rendered when opened root url in browser. ahaha!

what wrong?

thank in advance)


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -