我将我的CI项目上载到Nginx VPS,它对某些扩展名为“ .html”的路由不起作用。
这是我的路线:
options
在config.php文件中,我还设置了:
$route['contact'] = 'home/contact'; //it works ok
$route['contact.html'] = 'home/contact'; //it returns 404 error
在Nginx VPS中,我的nginx配置文件(mydomain.com.conf)如下:
$config['url_suffix'] = '.html'; //not have any affect
请帮助我采用server {
server_name mydomain.com www.mydomain.com;
access_log /home/nginx/domains/mydomain.com/log/access.log combined buffer=256k flush=60m;
error_log /home/nginx/domains/mydomain.com/log/error.log;
root /home/nginx/domains/mydomain.com/public;
index index.html index.php;
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/drop.conf;
#include /usr/local/nginx/conf/errorpage.conf;
}
路线。预先感谢。