Welcome! Log In Create A New Profile

Advanced

this is my first nginx server block, after activating it, at the browser, I keyed in subdomain name as my web address , it just jump to save file at my laptop's downloads directory with the filename Download

Posted by raymondraymond0517 
Hi,
This is my first server block. The filename lp.cce.academy, and the file content is as follows:

/etc/nginx/sites-available # cat lt.cce.academy

server {
listen 80;
listen [::]:80;
root /var/www/cce/leantime/public;
index index.html index.htm index.php;
server_name lt.cce.academy;

location / {
try_files $uri $uri/ =404;
}
}

my server is debian 11
I have previously installed apache2, but has disabled it,
systemctl status apache2, shows it is loaded, inactive (dead).

systemctl status nginx, shows it is active and running

At chrome browser from my remote laptop,
I keyed in "my IP address", it display nginx default home landing page. Which is correct.
when I keyed in "cce.academy" my domain name, it also display the nginx default home landing page.
but when I keyed in "lt.cce.academy", as my subdomain name, the leantime application is not running, instead, it jump to my laptop file download prompt, asking me to save a file "Download" to my downloads directory local drive.

I tested this subdomain name is working fine in apache2, it launched the application leantime as expected.

the directory listing of /var/www/cce/leantime/public # ls
backup.php fonts js robots.txt tmp
css images less SMTP.php userfiles
download.php index.php null theme

What is wrong with my configuration at lt.cce.academy file at the /etc/nginx/sites-available? I have created a symbolic link at the /etc/nginx/sites-enabled directory
of this configuration file.

Thank you.
Attachments:
open | download - Screenshot (528).png (51 KB)
Similar to the issue raised in this stack overflow question
https://stackoverflow.com/questions/61136822/nginx-accessing-my-website-with-subdomain-downloads-a-file

however, mine is a very basic configuration just to get leantime application running on a subdomain lt.cce.academy
Found the answer,

Nginx not installed with software to execute php file, that is why it downloads the php scrip instead of executing it
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 246
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready