nginx can't find my new server?
-
Guv and friends..
I used the lemp lucid ubuntu stackscript to setup my linode VPS.
http://vpsbible.com/vps-setup-guides/stackscripts/lemp-lucid-stackscript/
After some DNS confusion on my part I was able to hit the box.
Here is my problem, the server for some reason thinks its root is:
/usr/local/nginx/html
Whereas I am pointing in the config files to the right directory of:
/home/public_html/foo.com/public/
I am about 90% sure that the nginx is reading the foo.com conf file.
Here it is:
server {
listen 80;
server_name foo.com;
}
server {
listen 80;
server_name foo.com;
access_log /home/public_html/foo.com/log/access.log;
error_log /home/public_html/foo.com/log/error.log;
location / {
root /home/public_html/foo.com/public/;
index index.php index.html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/public_html/foo.com/public/$fastcgi_script_name;
}
}However, I did delete one line from the conf:
rewrite ^/(.*) http://foo.com/$1 permanent;
Because it was forwarding the http requests to the production foo.com server.
So - How do I fix this?
I did go through
http://vpsbible.com/web-servers/nginx-add-domains/
And everything is the same..
What am I missing?
Thanks,
DonPosted 1 year ago # -
Hi Don .. strange that .. can you print off the default vhost too pls .. maybe a combination error between that and DNS not yet resolving. path is:-
/usr/local/nginx/sites-available/default
Posted 1 year ago # -
Hey Guv,
Here it is:
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
}I did work around the problem - if I edit out the server {
listen 80;
server_name foo.com;
}part from the foo.com file - it finds the right root and I can work files from it..
So, unless you tell me I am mucking my life up for later then... I might stay on this config
Thanks,
Don
Posted 1 year ago # -
hey Don .. so, is your DNS propagated? to find out open a terminal and:-
ping mysite.com
if so, it should all be resolving now.
the default is good, no problem there. the reason the server thinks root is:-
/usr/local/nginx/html
is because that is what is stated in the default:-
root html;
so i suspect this has been a question of nameservers propagating (can take a few days) else new DNS settings coming through (should be within an hour or so).
that ping trick is quite handy.
Posted 1 year ago # -
Maybe that is the root of my issues - the site is an existing site with the DNS hosted elsewhere to slicehost.
I have read your DNS (http://vpsbible.com/dns/configure-vps-dns-domain-zone/) guide a few times - and I don't quite follow. And I have read (http://vpsbible.com/hosting/move-website-procedure/)
So - I just did this step:
http://vpsbible.com/dns/configure-vps-dns-domain-zone/
So - do I add to my local etc/hosts that my linode IP is my live site?
Then when I run all my installs refer to the linode domain as my original domain?
When I did this orginally - I found nginx forwarding to my original live domain...
Thanks,
Don
Posted 1 year ago # -
sorry Don .. been awol, you sorted with this?
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
