-1

I'm having trouble setting up a subdomain to a directory on my droplet (digital ocean):

I have my domain primarydomain.com of my droplet...i create a directory /livezilla/

Example:

primarydomain.com/livezilla

I want add a external subdomain to this directory (livezilla):

chat.myotherdomain.com.br

I have in: /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;

}
}

And

/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;
}

(with a copy on /etc/nginx/sites-enabled)

The chat.myotherdomain.com.br have a A Record in dns pointing to my droplet..

chat.myotherdomain.com.br now redirects to myotherdomain.com.br but with ping shows my droplet ip. )):

What's wrong?

1
  • I don't see it: Host chat.myotherdomain.com.br not found: 3(NXDOMAIN) Oct 5, 2015 at 12:02

1 Answer 1

1

This solved my question. Wtf.

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;
    }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .