• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • This community is user driven. Be polite with other users.
    • We recommend purchasing a Chevereto license to participate in this community.
    • Purchase a Community Subscription to get even faster ticket response times.
  • 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

nginx pages 404 error

jiajieit

Chevereto Member
I use nginx web server set up, everything is normal, but page 404 error page appears.

error demo:http://imgchr.com/page/contact

nginx conf;
Code:
server
        {
                listen 80;
                #listen [::]:80;
                server_name imgchr.com www.imgchr.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/imgchr.com;

                include none.conf;
                #error_page  404  /404.html;

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

                location ~ [^/]\.php(/|$)
                        {
                                # comment try_files $uri =404; to enable pathinfo
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                #include pathinfo.conf;
                        }


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

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

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

                rewrite ^/login(.*)$ https://imgchr.com/login$1 permanent;
                rewrite ^/signup(.*)$ https://imgchr.com/signup$1 permanent;

                access_log off;
        }

ftp;
搜狗截图20140801214225.png
 
Moved to servers. I've already told you the rules. Anything extra is up yo you.

Cheers.
 
Yes. I use that on the demo. Demo runs nginx. Anything else you want to add is up to you.
 
I understand why you've added some extra rules, but they aren't the cleanest way of doing what you want to do, see below. The try_files line above and a correct php block in your nginx vhost will ensure rewriting works properly.

This...
Code:
rewrite ^/login(.*)$ https://imgchr.com/login$1 permanent;

...might work better as:
Code:
rewrite ^/(login)$ https://$host/$1;

The correct code for the start of the php block is:
Code:
location ~ \.php$ {
 
Back
Top