• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Hello, request the latest full nginx rules for chevereto v3

jiajieit

Chevereto Member
Hello, request the latest full nginx rules for chevereto v3 3.3.2 .

I'm using nginx searched the forum rules, the current site 403 error occurs.

php 5.4.31
nginx/1.6.0

url:http://imgchr.com

the nginx rules;
Code:
server
{
listen 80;
server_name imgchr.com www.imgchr.com;
root /home/wwwroot/imgchr.com;

if ($host = 'www.imgchr.com' ) {
rewrite ^/(.*)$ http://imgchr.com/$1 permanent;
}

# location /
# {
# index index.html index.htm index.php;
#
# if (!-e $request_filename)
# {rewrite (.*) /index.php last;}
#
# try_files $uri $uri/ /index.php?$query_string;
# }

location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

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


location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 8d;
}

location ~ .*\.(js|css)?$
{
expires 8d;
}

location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ ^/(images)/ {
try_files $uri /content/system/404.gif;
expires 1y;
add_header Pragma public;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
}
 
Code:
location / {
    try_files $uri $uri/ /index.php?$query_string;
}
 
If you don't get a 502 error from nginx, trying checking the logs.

It doesn't look like you have a custom error log set. So add something like this to your vhost, then restart nginx:
Code:
error_log /var/logs/nginx/imgchr.error.log;

Reload the page in your browser and then take a look at the log.

There are also a few issues with your vhost. Try replacing your current php block with:
Code:
location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        # include full path to params if necessary (usually /etc/nginx/fastcgi_params)
        include fastcgi_params;
}

Also, make sure you have cgi.fix_pathinfo set to 0 in your php.ini.

The correct way to redirect www.yourdomain.com to yourdomain.com is as follows:

Code:
server {
listen 80;
server_name www.imgchr.com;
return 301 http://imgchr.com$request_uri;
}

server {
listen 80;
server_name imgchr.com;
...
}

Hopefully that will fix it. If not, paste the errors in the log here and also let me know what distro/version your using.
 
Last edited:
The logs will tell you the exact reason for the 404, they would be my first port of call. No point doing anything else until then.
 
location / {
index index.php;
try_files $uri $uri/ /index.php?$args;
}

location ~ \.(bmp|gif|jpeg|jpg|png)$ {
try_files $uri /content/system/null.gif;
}

location ~ (^/app/(.*)\.php$|^/lib/G) {
internal;
return 404;
}

location ~ (\.htaccess$|\.svn) {
internal;
return 404;
}

working for me just fine.
 
Back
Top