Hi everyone,
Im trying to set up a subdomain on Nginx that points to a folder that has all my 2nd laravel sites files. I already have a working version of laravel on this same server just as the main domain though.
UPDATED CODE
file structure is:
var/www/laravel/public (Main Site laravel install working!)
var/www/api/public (Second laravel site want to point subdomain to)
I already followed a ton of tutorials with no luck.
in etc/nginx/sites-available I made a copy of the working default that point to main site. Changed file name to api and content to:
server {
listen 80;
root /var/www/api/public/;
index index.php index.html index.htm;
server_name api.mysite.me;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Then in terminal:
sudo ln -s /etc/nginx/sites-available/api /etc/nginx/sites-enabled/api
sudo service nginx restart
etc/hosts:
000.0.0.0 localhost
000.0.0.0 password password
api.mysite.me localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
What am i doing wrong?
I created the domain names for DNS, do I also need to do any kind of pointing of @ or Cnames?