This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jonagoldman16975
jonagoldman16975

I have a DigitalOcean droplet running multiple Laravel sites (setup using this guide).

I added the NGINX configuration from the October docs.

This results in something like this:

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

        root /var/www/myoctober;
        index index.php index.html index.htm;

        server_name myoctober.com;

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        rewrite ^themes/.*/(layouts|pages|partials)/.*.htm /index.php break;
        rewrite ^bootstrap/.* /index.php break;
        rewrite ^config/.* /index.php break;
        rewrite ^vendor/.* /index.php break;
        rewrite ^storage/cms/.* /index.php break;
        rewrite ^storage/logs/.* /index.php break;
        rewrite ^storage/framework/.* /index.php break;
        rewrite ^storage/temp/protected/.* /index.php break;
        rewrite ^storage/app/uploads/protected/.* /index.php break;

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;

                # php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

But it does't work. I get a 500 error. Any suggestions?

Last updated

Parsec
Parsec

I have no experience with DigitalOcean, but perhaps it's php is not supposed to be used with a socket, but listens on port 9000, like it says in the comment

jonagoldman16975
jonagoldman16975

Thanks for the reply. I have no experience with NGINX but I have this PHP configuration working on multiple Laravel sites. I configured NGINX using the DigitalOcean guide so this is kind of their standart configuration. I guess anyone using their guides will have this same problem. Do you have a configuration example for other hostings?

Last updated

Keios
Keios

@Parsec, what? This is 500 error, not 502, nginx will not give you 500 error if the fastcgi_pass is wrong, how could it? :D

jonagoldman16975, hhvm by default logs 500 errors with explanation in /var/log/hhvm/error.log, but in case of php5 you need some more actions: take a look here http://stackoverflow.com/questions/2687730/how-can-i-make-php-display-the-error-instead-of-giving-me-500-internal-server-er and try to find out what the error means exactly.

I would guess something failed with october installation, but can't really tell anything without knowing at what point of code php crashes with 500.

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.