【发布时间】:2016-07-31 20:16:48
【问题描述】:
所以我有一个我自己的网站的统计页面,我希望做以下事情;
User types: sub.mydomain/u/Username
End result: sub.mydomain/stats.php?player=Username
I want the end result to still show sub.domain/u/Username
然而,似乎 php 文件被下载了,这是一个主要问题,因为它包含我的数据库信息。我正在使用 Centos 6,完全安装了 Php 以及 php-fpm。
这是我的 virtual.conf 文件:
location ~ \.php$ {
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
server {
listen 80;
server_name stats.mydomain;
root /var/www/mydomain/public_html/stats/;
location / {
proxy_pass http://mydomain/stats/home.php;
}
location /u {
rewrite ^/u/(.*)$ /stats.php?player=$1 last;
}
}
我已经阅读了其他人的问题和回复,但这似乎并没有解决我的问题。
谢谢!
【问题讨论】: