Described below in Nginx's official wiki
The alias directive cannot is used inside a regex-specified location. If you need to does this you must use a combination of rewrite and root.
In the actual use of alias in the following PHP returns 404, and HTML can be displayed normally, the workaround is as follows
Location/{
root/opt/www/htdocs/www;
Index index.php index.html index.htm;
}
location/bbs/{
alias/opt/www/htdocs/bbs/;
Index index.php index.html index.htm;
}
Location ~ ^/bbs/.+.php{
Root/opt/www/htdocs;
rewrite/bbs/(. *.php?)/1 break;
Include conf/fcgi.conf;
Fastcgi_pass 127.0.0.1:10080;
Fastcgi_index index.php;
Fastcgi_param Script_filename/opt/www/htdocs/bbs$fastcgi_script_name;
}
Replace alias with Root plus rewrite
Source: http://blog.tcisv.cn/index.php/2009/06/phpfastcgi%E5%9C%A8nginx%E7%9A%84alias%E4%B8%8B404%E7%9A%84%E8%A7%A3 %e5%86%b3%e6%96%b9%e6%a1%88/
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the phpfastcgi in Nginx under the alias 404 of the solution, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.