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

awc13970
awc13970

I finally got the site working. I'm using Ajenti hosting control panel that replaces Apache with Nginx which I'm very new to. After a bunch of digging, I found a site that gave me an example of the custom config for nginx to replace the htaccess file. Here is what I'm using for that:

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;       
}

Most things work. But when trying to go to the Add User page in the backend I get "502 Bad Gateway".

Any ideas?

Thanks!

Crazymodder
Crazymodder

Hi,

please try with this config:

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

location ~ \.php$ {
            try_files $uri /index.php =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
}

Please post error message from nginx if you get this 502 Bad Gateway. Mostly you can found this under /var/log/nginx/xxxxxx.log

Regards Crazymodder

Last updated

awc13970
awc13970

Thanks. I've tried what you suggested and here's the error from the log (my domain replaced):

2016/02/15 14:01:25 [emerg] 23671#0: unexpected "}" in /etc/nginx/conf.d/exampledomain.conf:20
2016/02/15 14:01:25 [emerg] 23673#0: unexpected "}" in /etc/nginx/conf.d/exampledomain.conf:20

Turns out the code you gave me was just missing the ending ";" in the try_files line. I've corrected that and it all works now. Thanks!!!

Crazymodder
Crazymodder

Ah ok my fail sorry. Ok great if its working now:)

1-4 of 4

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