I'm currently working on Ubuntu 18.04 server and trying to get my vhosts with nginx to work.
Seems like my nginx server block is not properly working, but I'm not sure what im doing wrong. I'm trying to host 3 domains:
clan.mydomain.de blog.mydomain.de webmail.mydomain.de
Ive also installed Iredmail, which edited the default file under sites-available like this:
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name webmail.addictedtogames.de.com www.webmail.addictedtogames.de;
location / {
try_files $uri $uri/ =404;
}
}
then i created 2 new files called: clan.addictedtogames.de and blog.addictedtogames.de
clan.addictedtogames.de nginx server block:
server {
listen 80;
listen [::]:80;
root /var/www/clan.addictedtogames.de/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name clan.addictedtogames.de www.clan.addictedtogames.de;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass 127.0.0.1:9999;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
It works all like a charm, except that when I visit clan.addictedtogames.de , it'll download a file.
I would appreciate it, if you can help me. If you need any more informations, feel free to ask :)
Kind Regards,
Yeriwen