Nginx set subdomain to work with php -


what want achive this:

create subdomain my.domain.com execute index.php on 

i created file called my.conf , put in /etc/nginx/conf.d/my.conf

inside of put nex code:

server{     listen 80;     listen [::]:80;      root /var/www/my;      index index.php index.html;      server_name my.domain.com;     location / {         try_files $uri $uri/ =404;     }      location ~ \.php$ {         include snippets/fastcgi-php.conf;         fastcgi_pass unix:/run/php/php7.0-fpm.sock;     }      location ~ /\.ht {         deny all;     } } 

i created record type: a, name: my, value: ip

i put file inside /var/www/my/ called index.php , wrote small echo;

i did nginx -t , fine. sudo service nginx restart , sudo systemctl reload nginx.

everytime when visit my.domain.com content domain.com. looks my.conf doesn't should because don't see index.php content on subdomain.

any ideas doing wrong?

edit: use cloudflare.

thanks


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -