LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-18-2014, 05:39 PM   #1
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
nginx - subdomain is always redirected to "www"?


Hi.

Following issue: I have Ubuntu LTS and nginx and I want to have a subdomain ("new.domain.net"). I added an A record and a nginx config for it but it doesnt work, I'm always redirected to "www".

www.domain.net: works.
new.domain.net: redirection to www.
nww.domain.net: 404.

So I'd basically assume that DNS is propagated. It must be my configuration.

"www" config:

Code:
    server {
        listen       80;
        server_name  domain.net;
     
        root   /var/www/domain.net/public;
        index  index.html index.php;
     
        location ~ \.php$ {
            #root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_read_timeout  80;
            fastcgi_param  SCRIPT_FILENAME  /var/www/domain.net/public/$fastcgi_script_name;
            include        fastcgi_params;
        }
     
        # make system internal
        location /system {
            internal;
        }
     
        # client php-fpm
        location @php-fpm {
            internal;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_read_timeout  80;
            fastcgi_param  SCRIPT_FILENAME  /var/www/domain.net/public/$fastcgi_script_name;
            include        fastcgi_params;
        }
     
        location /system {
        }
    }
"new" config:

Code:
server {
         listen *:80;
         server_name new.domain.net;
         root /var/www/new-site;
     
        location /internal_data/ {
           internal;
        }
        location /library/ {
           internal;
        }
     
        index index.html index.htm index.php index.cgi index.pl index.xhtml;
     
         location / {
             try_files $uri $uri/ /index.php?$uri&$args;
         }
     
         location ~ \.php$ {
             fastcgi_pass    127.0.0.1:9000;
             fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
             include         fastcgi_params;
         }
    }
GoDaddy domain config:

http://oi59.tinypic.com/dxbqtg.jpg

Any clues?
 
Old 10-22-2014, 02:20 PM   #2
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Original Poster
Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
*bump*
 
Old 10-25-2014, 04:42 PM   #3
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Original Poster
Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
*bump*
 
Old 10-27-2014, 09:03 PM   #4
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Original Poster
Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
+1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open Recall: NSH, nginx 1.2.7, Coreboot for the "Butterfly" LXer Syndicated Linux News 0 02-13-2013 11:21 PM
Some Joomla administration links give "Component not found" with nginx sydney-troz Linux - Server 3 10-29-2009 04:37 PM
tcl/expect stdout redirected to file stops (possibly due to a "@" in exp_send) cejennings_cr Programming 1 07-08-2009 06:01 PM
"www::mechanize"-->www.cpan.org using this module login to secure website vvnkishore Linux - General 0 10-04-2007 01:14 AM
localhost:901 gets redirected to "Power Linking" web site advertisement condosolon Linux - Newbie 2 03-04-2004 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration