【发布时间】:2013-11-26 21:41:01
【问题描述】:
我正在使用以下配置设置,但它正在下载执行时的索引源文件。但是如果放置 index.html 而不是 index.php,则会显示 index.html 的输出
总的来说,它似乎没有读取 php 文件。
server {
server_name test.com;
root /var/www/test;
index index.html index.php;
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
location / {
# Check if a file or directory index file exists, else route it to index.php.
try_files $uri $uri/ /index.php;
}
location ~ /\.ht {
deny all;
}
}
【问题讨论】: