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.
<pre> 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;
}
} </pre>
#WEb mobile <pre> 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;
}
} </pre> Thank you very much!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Looks like you’ve got it up and running! I see the mobile site when I visit http://m.phimcucnhanh.com Would you mind sharing what you needed to fix to help the next person who comes along?
I don’t see anything particularly wrong with those configurations. Were you seeing errors in the logs? What happened when you tried visiting the mobile site, was there an error message?
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.