Nginx serves .php files as downloads, instead of executing them

By colourful at 2017-06-11 • 1 collector • 162 pageviews

Could anyone help me please? ;c

Everytime i try to load the index.php, it would automatically download a file all the time.

/etc/nginx/sites-enabled:

server {

    listen 80;


    root /var/forums.hoursplayed.net;

    index index.html index.htm index.php;


    # Make site accessible from http://localhost/

    server_name forums.hoursplayed.net;


    # nginx configuration

error_page 404 /404.php;


# rewrite

location / {

try_files $uri $uri/ /index.php?$query_string;

}


# Git folder vulnerability

location /.git {

deny all;

return 403;

}


location /controller {

deny all;

return 403;

}

location /docker_resources {

deny all;

return 403;

}

location /library {

deny all;

return 403;

}

location /service {

deny all;

return 403;

}

location /view {

deny all;

return 403;

}

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

location ~ /\.ht {

deny all;

return 403;

}

}

/var/forums.hoursplayed.net:

1497164635874593.png

That is how it look like when i entered the link.

Microsoft Edge :

1497164428489350.png

Google Chrome :

1497164562440422.png

Could anyone help me pls ;c

3 Replies | Last update 9 days ago
22 days ago   #1
If you were looking for the best tutorial that helps you in searching file explorer windows 10 then from here you will do it step by step with the help of our tutorial.
12 days ago   #2

I agree with what you share. It will be very useful information for everyone. Hope your next posts are as well  fireboy and watergirl

9 days ago   #3

Great post! I didn’t knowral of these resources and I’m going to go check them out now! twitch

Requires Login

Loading...