在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
其实也是很简单的方法,修改nginx.conf文件,加入以下内容: 复制代码 代码如下: location / { if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } } 重启nginx就可以了。 以下是我的配置文件实例: www# cat nginx.conf user www www; #error_log logs/error.log; #pid logs/nginx.pid; events { http { #log_format main '$remote_addr - $remote_user [$time_local] $request ‘ #access_log logs/access.log main; sendfile on; #keepalive_timeout 0; #gzip on; server { #charset koi8-r; #access_log logs/host.access.log main; location / { } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # deny access to .htaccess files, if Apache's document root # another virtual host using mix of IP-, name-, and port-based configuration # location / { # HTTPS server # ssl on; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # location / { |
请发表评论