NginxAlias cannot parse PHP solution: server {??????? Listen ?????? 80 ;??????? Server_name? Xxxx.com.cn ;??????? Error_log? Tmperor. log ;??????? Set $ www_root Nginx Alias solution for failing to parse PHP
Nginx Alias cannot parse PHP solution:
Server {
??????? Listen ?????? 80;
??????? Server_name? Xxxx.com.cn;
??????? Error_log? /Tmp/eror. log;
??????? Set $ www_root/home/web/yqbb/bgskk;
??????? Location /{
??????????? Root ?? $ Www_root;
??????????? Index? Index.html index. php;
??????? }
??????? Location/feedback {
??????????? Index? Index. php;
??????????? Alias/home/web/yqbb/bgskk/app/htdocs;
??????? }
??????? Error_page ?? 500 502 503 504? /50x.html;
??????? Location =/50x.html {
??????????? Root ?? Html;
??????? }
??????? Location ~ ^/Feedback/. + \. php $ {
??????????????? Root/home/web/yqbb/bgskk/app/htdocs;
??????????????? Rewrite/feedback/(. * \. php ?) /$1 break;
??????????????? Include fastcgi. conf;
??????????????? Fastcgi_pass ?? 127.0.0.1: 9000;
??????????????? Fastcgi_index? Index. php;
??????????????? Fastcgi_param SCRIPT_FILENAME/home/web/yqbb/bgskk/app/htdocs/$ fastcgi_script_name;
??????? }
??????? Location ~ . * \. (Php | php5 )? $ {
??????????????? Fastcgi_pass? 127.0.0.1: 9000;
??????????????? Fastcgi_index index. php;
??????????????? Include fastcgi. conf;
??????? }
??? }
?
?
Server
??? {
??????? Listen 80 ;? # Port number
??????? Server_name www.linuxidc.com ;?? # Domain name
??????? Index index.html index.htm index. php index.shtml ;? # Default homepage
??????? Root? /Var/www/html ;? # Website root directory
??????? Charset gbk ;??? # Default encoding
??????? Location/public /? # Set the directory name to be overwritten
??????? {
??????????????? Alias/var/www/public/; # redirect destination directory.
??????????????? # Example: If the user access the http://www.linuxidc.com/public/test.html will not access/var/www/html/public/test.html, while the access is/var/www/public/test.html, although this file is not in the domain name Directory
??????? }
# After completing the above settings, we found that accessing the php file ghost
# Start
??????? Location ~ ^/Public/. + \. php $
??????? {
??????????????? Root/var/www/html/web/news/public;
??????????????? Rewrite/public/(. * \. php ?) /$1 break;
??????????????? Include fastcgi. conf;
??????????????? Fastcgi_pass ?? 127.0.0.1: 9000;
??????????????? Fastcgi_index? Index. php;
??????? }
# End
??????? Location ~ . * \. (Php | php5 )? $
??????? {
??????????? # Fastcgi_pass? Unix:/tmp/php-cgi.sock;
??????????? Fastcgi_pass? 127.0.0.1: 9000;
??????????? Fastcgi_index index. php;
??????????? # Include fcgi. conf;
??????????? Include fastcgi. conf;
??????????? Rewrite? ^/([A-zA-Z] +) \/([a-zA-Z] +) $/listen 2.shtml last;
??????? }
??????? Location ~ . * \. (Gif | jpg | jpeg | png | bmp | swf) $
??????? {
??????????? Expires ????? 30d ;? # Cache for 30 days
??????? }
??????? Location ~ . * \. (Js | css )? $
??????? {
??????????? Expires ????? 1 h; # cache for 1 hour
??????? }
??????? Access_log? /Var/log/linuxidc. log? Access ;? # Define log files
??????? Ssi on;
??????? Ssi_silent_errors on;
??????? Ssi_types text/shtml;
??? }