Hello,

After following lots of tutorials and suggestion I finally managed to upload my rails app to development.
Now I’m getting 500 errors when visiting my IP: http://157.245.125.174/
The logs aren’t saying too much:

2020/05/27 22:22:15 [info] 24634#24634: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:65
[ N 2020-05-27 22:22:15.8023 24652/T1 age/Wat/WatchdogMain.cpp:1373 ]: Starting Passenger watchdog...
[ N 2020-05-27 22:22:15.8398 24658/T1 age/Cor/CoreMain.cpp:1340 ]: Starting Passenger core...
[ N 2020-05-27 22:22:15.8399 24658/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
[ N 2020-05-27 22:22:15.8474 24658/T1 age/Cor/CoreMain.cpp:1015 ]: Passenger core online, PID 24658
[ N 2020-05-27 22:22:18.2526 24658/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)
App 24681 output:  [passenger_native_support.so] trying to compile for the current user (www-data) and Ruby interpreter...
App 24681 output:      (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
App 24681 output:      Compilation successful. The logs are here:
App 24681 output:      /tmp/passenger_native_support-ucpkvk.log
App 24681 output:  [passenger_native_support.so] successfully loaded.
2020/05/27 22:29:34 [alert] 24670#24670: *9 open socket #11 left in connection 5
2020/05/27 22:29:34 [alert] 24670#24670: aborting
2020/05/27 22:29:34 [info] 25097#25097: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:65
[ N 2020-05-27 22:29:34.3360 25116/T1 age/Wat/WatchdogMain.cpp:1373 ]: Starting Passenger watchdog...
[ N 2020-05-27 22:29:34.3761 25122/T1 age/Cor/CoreMain.cpp:1340 ]: Starting Passenger core...
[ N 2020-05-27 22:29:34.3763 25122/T1 age/Cor/CoreMain.cpp:256 ]: Passenger core running in multi-application mode.
[ N 2020-05-27 22:29:34.3833 25122/T1 age/Cor/CoreMain.cpp:1015 ]: Passenger core online, PID 25122
[ N 2020-05-27 22:29:36.8096 25122/T5 age/Cor/SecurityUpdateChecker.h:519 ]: Security update check: no update found (next check in 24 hours)
/var/log/nginx/error.log (END)

And here is my config in:

****/etc/nginx/sites-enabled/rdm_ruby

server {
  listen 80;
  listen [::]:80;

  server_name 157.245.125.174 reinodemallorca.com www.reinodemallorca.com;
  root /home/deploy/rdm_ruby/public;

  passenger_enabled on;
  passenger_app_env production;

  location /cable {
    passenger_app_group_name rdm_ruby_websocket;
    passenger_force_max_concurrent_requests_per_process 0;
  }

  # Allow uploads up to 100MB in size
  client_max_body_size 100m;

  location ~ ^/(assets|packs) {
    expires max;
    gzip_static on;
  }
}

and my other config in:

****/etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
        passenger_ruby /root/.rbenv/shims/ruby;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
# gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
.... more commented lines

Am I’m missing something??
Can someone help me out with this?
P.D. My app in local works fine and with no errors on logs.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi there @sergiumironescu,

I can see that you’ve managed to get the website up and running! Would you mind sharing the solution here with the community?

Usually, if you get 500 errors from Nginx, I would suggest checking the Nginx error logs for more information.

Another thing that you could do is follow the steps from this answer here on how to troubleshoot common Nginx problems:

https://www.digitalocean.com/community/questions/how-to-troubleshoot-common-nginx-issues-on-linux-server

Regards,
Bobby

Submit an Answer