제가 소유한 a도메인에 

 

test.a.com으로 해서 연결을 하고 싶은데요

 

sites-enabled 에

 

 

server {

        listen 80;

 

        server_name test.anipharm.net;

        root /home/testanipharm/public_html;

 

        include snippets/xe-rewrite.conf;

 

        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|swf|gif)$ {

                access_log        off;

                log_not_found     off;

                expires           30d;

        }

 

        location ~ \.php$ {

                fastcgi_pass php5-fpm-sock;

                include snippets/php-fastcgi.conf;

        }

}

 

이렇게 구성을 했는데 안되네요.. 

 

서브도메인 아닌것은 이걸로 잘 구성을 했는데요. 서브도메인은 안되네요 뭐가 문제일까요

 

그냥 원도메인으로 넘어가 버립니다.

  • profile

    test뿐 아니라 asdasd처럼 아무 서브도메인이나 입력해도 모두 anipharm.net과 같은 화면이 나오는 것을 보면 와일드카드 설정이 되어 있는 것 같습니다.  혹시 다른 anipharm.net 파일에서 server_name *.anipharm.net 이렇게 모든 서브도메인을 다 먹어버렸거나, 모든 서브도메인을 처리하는 설정파일이 따로 있지 않나요?

  • profile profile
    server {
    listen 80 default;

    server_name anipharm.net www.anipharm.net;
    root /home/anipharm/public_html;

    include snippets/xe-rewrite.conf;
    include snippets/xe-rewrite-extra.conf;

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|swf|gif)$ {
    access_log off;
    log_not_found off;
    expires 30d;
    }

    location ~ \.php$ {
    fastcgi_pass php5-fpm-sock;
    include snippets/php-fastcgi.conf;
    }
    }

    anipharm의 설정파일은 이렇게 되어있습니다.

    제가 이상한게 저는 phpmyadmin이 이 도메인의 서브도메인으로 되어있거든요..

    server {
    listen 80;

    server_name phpmyadmin.anipharm.net;
    root /usr/share/phpmyadmin;

    location /munin {
    alias /var/cache/munin/www;
    access_log off;
    }

    location /status {
    stub_status on;
    access_log off;
    }

    location ~ \.php$ {
    fastcgi_pass php5-fpm-sock;
    include snippets/php-fastcgi.conf;
    }
    }
    ~
  • profile profile
    anipharm.net이 소속된 server가 default로 되어 있어서, 인식하지 못하는 서브도메인은 모두 그쪽으로 보내는 것 같습니다. default가 문제가 아니라 새로 추가하신 test를 왜 인식하지 못하는지 알아내야겠네요. nginx 재시작은 해보셨나요?
  • profile profile
    네 몇번이나 재시작해보았죠 ㅎㅎㅎ 설정이 잘못된건 아니네요.. 뭔가 다른 게 필요한거네요
  • profile profile
    어이가 없는데.. nginx -s reolad 라고 하니깐 적용이 잘 되네요

    그전에는 service nginx restart 이걸로 늘 했었는데.. 무슨 차이가 있길래..헐
  • profile profile
    nginx를 오랫동안 켜두었거나, 켜둔 사이에 새 버전으로 업데이트되었다면 재시작 명령이 안 듣는 경우가 가끔 있어요. 심할 때는 killall -9 nginx로 강제 종료하고 다시 켜야 하기도 합니다 ㅠ