Question

Help configuration - Nginx and Cakephp

Posted June 19, 2014 4.2k views
Hello! I'm DoanNam. Please help me! I used cakephp and nginx. My vhost.conf file as follows: #start vhost.conf
server {
    listen   80;
    server_name phimcucnhanh.net;

    root   /www/website/phimcucnhanh.net/app/webroot/;
    index  index.php;

    access_log /www/website/phimcucnhanh.net/log/access.log;
    error_log /www/website/phimcucnhanh.net/log/error.log;
	
			
    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include /etc/nginx/fastcgi_params1;
        fastcgi_pass    127.0.0.1:9000;
        fastcgi_index   index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	
    }
}

server {
    listen   80;
    server_name m.phimcucnhanh.net;

    
    root   /www/website/m.phimcucnhanh.net/app/webroot/;
    index  index.php;

    access_log /www/website/m.phimcucnhanh.net/log/access.log;
    error_log /www/website/m.phimcucnhanh.net/log/error.log;
	
			
    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include /etc/nginx/fastcgi_params2;
        fastcgi_pass    127.0.0.1:9000;
        fastcgi_index   index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		#fastcgi_param SCRIPT_FILENAME /www/website/phimcucnhanh.net/app/webroot/index.php;
    }
}
#End vhost.conf You go to the following link: "http://m.phimcucnhanh.net/ban-cung-lop-my-old-classmate-2014" Then the link: "http://phimcucnhanh.net/ban-cung-lop-my-old-classmate-2014" will see the error message:
Stack Trace
    / Www / sites / m.phimcucnhanh.net / lib / Cake / Routing / Dispatcher.php line 186 → Controller-> invokeAction (CakeRequest)
    / Www / sites / m.phimcucnhanh.net / lib / Cake / Routing / Dispatcher.php → line 161 Dispatcher-> _invoke (CommonController, CakeRequest, CakeResponse)
    / Www / sites / m.phimcucnhanh.net / lib / Cake / Core / Object.php line 97 → Dispatcher-> dispatch (CakeRequest, CakeResponse, array)
This proves the link "http://phimcucnhanh.net/ban-cung-lop-my-old-classmate-2014" it is not running in / www/website/phimcucnhanh.net / but if you press f5 a few times is off errors. I've lost so many days yet to fix it. I look forward to the help from you! Thank you very much

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! I'm still not sure exactly what your issues is. The Nginx configuration looks fine to me, and if I visit either version of you site, I see the content: Desktop: http://i.imgur.com/PuEY05X.jpg Mobile: http://i.imgur.com/t2B2xfG.png I've reloaded it multiple times without error. When exactly do you see that error? When it happens, what do you see in /www/website/phimcucnhanh.net/log/error.log ?
  • Hi astarr! - The first you visit http://m.phimcucnhanh.net/kim-chi-ca-phao ( Mobile: http://file.phimcucnhanh.net/1.png ) - Step 2 you visit http://phimcucnhanh.net/kim-chi-ca-phao (Desktop: http://file.phimcucnhanh.net/2.png) You pull down the website finally see the following error: "Stack Trace / www / sites / m.phimcucnhanh.net / lib / Cake / Routing / Dispatcher.php line 186 → Controller-> invokeAction (CakeRequest) / www / sites / m.phimcucnhanh.net / lib / Cake / Routing / Dispatcher.php → line 161 Dispatcher-> _invoke (CommonController, CakeRequest, CakeResponse) / www / sites / m.phimcucnhanh.net / lib / Cake / Core / Object.php line 97 → Dispatcher-> dispatch (CakeRequest, CakeResponse, array) APP / View / Elements / content_right.ctp line 39 → Object-> requestAction (string) .... ". I opened the file error.log /www/website/phimcucnhanh.net/log/error.log found it empty. Please help me! Thank astarr!
Submit an Answer