외부 하위 도메인용 Nginx 가상 호스트

외부 하위 도메인용 Nginx 가상 호스트

문제가 발생했습니다내 드롭릿의 디렉터리에 하위 도메인 설정(디지털 바다):

내 드롭렛의 도메인인 Primarydomain.com이 있습니다...디렉토리 /livezilla/를 만듭니다.

예:

Primarydomain.com/livezilla

나는 원해요이 디렉터리에 외부 하위 도메인을 추가해 주세요(라이브질라):

chat.myotherdomain.com.br

나는 /etc/nginx/sites-avaliable/primarydomain.com에 있습니다:

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.php index.html index.htm;

server_name primarydomain.com;

location / {

try_files $uri $uri/ /index.php?q=$uri&args;

}
}

그리고

/etc/nginx/sites-avaliable/chat.myotherdomain.com.br

server {
listen 80;
listen [::]:80;
server_name chat.myotherdomain.com.br;
root /usr/share/nginx/html/livezilla/;
index index.php index.html index.htm;
}

(/etc/nginx/sites-enabled에 복사본 포함)

그만큼chat.myotherdomain.com.br에는 A 레코드가 있습니다.내 물방울을 가리키는 DNS에서 ..

chat.myotherdomain.com.br은 이제 myotherdomain.com.br로 리디렉션되지만 ping을 사용하면 내 드롭릿 IP가 표시됩니다. )):

뭐가 문제 야?

답변1

이것은 내 질문을 해결했습니다. 뭐야.

server {
        listen chat.myotherdomain.com.br:80;
        server_name chat.myotherdomain.com.br;

        root /usr/share/nginx/html/livezilla;
        index index.php index.html index.htm;

     location ~ \.php$ {

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }
}

관련 정보