Question
Help me cakephp and nginx
Dear!
I'm using nginx VPS.
Source cakephp code
But now I can not get vhost configuration.
My site is http://phimcucnhanh.com have successfully configured.
But I add configuration for website mobile http://m.phimcucnhanh.com not run.
I want to run in fodel http://m.phimcucnhanh.com domain name www / sites / m.phimcucnhanh.com / but I do not. It took me 2 days to do this without success. We wish your help.
# Vhost.conf
server { listen 80; server_name www.phimcucnhanh.net phimcucnhanh.net www.phimcucnhanh.com; rewrite ^(.*) http://phimcucnhanh.com$1 permanent; } server { listen 80; server_name phimcucnhanh.com; # root directive should be global root /www/website/phimcucnhanh.com/app/webroot/; index index.php; access_log /www/website/phimcucnhanh.com/log/access.log; error_log /www/website/phimcucnhanh.com/log/error.log; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; 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.com/app/webroot/index.php; } }#WEb mobile
server { listen 80; server_name m.phimcucnhanh.com; # root directive should be global root /www/website/m.phimcucnhanh.com/app/webroot/; index index.php; access_log /www/website/m.phimcucnhanh.com/log/m.access.log; error_log /www/website/m.phimcucnhanh.com/log/m.error.log; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; 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/m.phimcucnhanh.com/app/webroot/index.php; } }Thank you very much!
Add a comment
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.
×