Php-nginx after the installation is successful, Access IP prompts for Internal Server Error

Source: Internet
Author: User
Keywords Nginx PHP Configuration
nginxphp Configuration

Intercept the error message as follows:

The nginx.conf profile is a copy of someone else's tutorial.

#user nobody;
Worker_processes 1;

Error_log Logs/error.log;
#error_log Logs/error.log Notice;
#error_log Logs/error.log Info;

#pid Logs/nginx.pid;

Events {
Worker_connections 1024;
}

HTTP {
Include Mime.types;
Default_type Application/octet-stream;

Log_format Main ' $remote _addr-$remote _user [$time _local] "$request" "$status $body _bytes_sent" $htt P_referer "" "$http _user_agent" "$http _x_forwarded_for" "Sendfile on; #tcp_nopush on; #keepaliv    E_timeout 0;keepalive_timeout, #gzip on;server {Listen 80;    server_name sanhe.phis.bz static.phis.bz;    Root e:/phis/admin;    Index index.html index.htm index.php;    #access_log Logs/host.access.log Main;            Error_page 404 405/error/404.html;    Error_page 502 503 504/error/50x.html; #--request php file (use for www.phis.bz) #location ~. *\.    (PHP|PHP5)? $ {# Fastcgi_pass 127.0.0.1:9000;    # Fastcgi_index index.php;    # Fastcgi_param Script_filename E:/phis/admin$fastcgi_script_name;    # include Fastcgi_params.phis; #} #--request image file location ~. *\.        (gif|jpg|jpeg|png|bmp) $ {access_log off;    Expires 1h; } #--request static File Location ~. *\.        (js|css|swf)? $ {Access_log off;    Expires 2d; } #--can not the request file location ~*. *\. (asp|aspx|dl|htaccess) ($|\?)        {return 405;    Access_log off; } #--can not visite dir location ~*. *\/(Controllers|views|lib|log|cron) (\/|$|\?)    {return 405;        } #--http Request Location/{Fastcgi_pass 127.0.0.1:9000;        Fastcgi_index index.php;        Fastcgi_param Script_filename E:/phis/admin$fastcgi_script_name;        Include Fastcgi_params.phis;            #all request to index.php if (!-e $request _filename) {#return 500;        Rewrite ^/(. *) $/index.php last; }    }}

}

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.