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

By colourful at 2017-06-11 • 0人收藏 • 1726人看过

求幫忙啊 ;c

/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:

evouaNI.png

2 个回复 | 最后更新于 2017-06-11
2017-06-11   #1

如果用Browser開啟的話:

Microsoft edge : 

download.png

Google Chrome :

download2.png

2017-06-11   #2

成功了 沒事了

登录后方可回帖

登 录
信息栏

Carbon Forum是一个基于话题的高性能轻型PHP论坛

下载地址:Carbon Forum v5.9.0
QQ群:12607708(QQ我不常上)

donate

手机支付宝扫描上方二维码可向本项目捐款

粤公网安备 44030602003677号
粤ICP备17135490号

Loading...