nginx:所有stream量到index.php

我怎样才能发送所有stream量到一个index.php文件,无论path或域? 什么是在nginx.conf中做到这一点的最快方法? try_files?

感谢您的见解

# Assuming you want static files as well server { listen 80 default_server; # Use default; instead if you're still on 0.7.x. try_files $uri /index.php; # Standard PHP location block here. } # Assuming you do not want static files as well server { listen 80 default_server; # Use default; instead if you're still on 0.7.x. location = /index.php { # Fastcgi/proxy pass } location / { rewrite ^ /index.php last; } } 

首先想到的答案,我想你可以把它放在最有利于你的地方。

 rewrite .* /index.php;