This question has been archived.

When navigating to subdomain, I get a "download" file instead of the actual website

February 6, 2015 4.8k views

I've tried doing everything I can think of, but I can't fix this. I'm not exactly an expert in Nginx configuration, which I think might be the cause of this issue.

The problematic subdomain is this:

It's simply a MyBB forum. It's worked for a while, but I was experimenting with Ajenti and Ajenti V a few days ago. The problems began after I uninstalled those. Given that Ajenti V overwrite Nginx configurations, I figure that's where the issue likely is. However, I can't figure out what Ajenti V would have changed, and I did a reinstall of nginx just in case.

Here's the server block for the subdomain:

server {
    listen 80;
    #listen [::]:80 ipv6only=on;

    root /var/www/;
    index index.php index.html index.htm;


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

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;

The permissions for the root folder are correct, I believe, but I may be mistaken:

drwxr-sr-x 11 www-data www-data 4096 Oct 10 16:02

I thought it might have something to do with php5-fpm, so I reinstalled php5-fpm and it's working fine on my main domain.

  • I assume this is fixed since I can see your MyBB board.

  • I suppose it is. Either it just needed time, or clearing out my browser cache fixed it. It's always the simplest solutions you overlook...

Be the first one to answer this question.