Nginx + PHP configuration in Windows 7

Source: Internet
Author: User

Download nginx and PHP.
Decompress nginx to drive C and PHP to drive C respectively.

Configure c: \ nginx \ conf \ nginx. conf as follows. My WWW Service is placed under the localhost folder of D: disk.

# 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 "$ http_referer"' # '"$ http_user_agent" $ http_x_forwarded _ For "'; # access_log logs/access. log main; sendfile on; # tcp_nopush on; # keepalive_timeout 0; keepalive_timeout 65; # gzip on; server {Listen 80; SERVER_NAME localhost; # charset koi8-r; # access_log logs/host. access. log main; Location/{root D:/localhost; // place the index index.html index.htm index in the Web service directory. PHP; Autoindex on ;}# error_page 404/404 .html; # redirect server error pages to the static page/50 X.html # error_page 500 502 503 504/50 x.html; location =/50x.html {root HTML;} # proxy the PHP scripts to Apache listening on 127.0.0.1: 80 # location ~ \. Php $ {# proxy_pass http: // 127.0.0.1; #}# pass the PHP scripts to FastCGI server listening on 127.0.0.1: 9000 # location ~ \. PHP $ {root D:/localhost; fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. PHP; fastcgi_param script_filename D:/localhost $ fastcgi_script_name; Include fastcgi_params;} # deny access. htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\. HT {# deny all ;#}# another virtual host using mix of IP-, name-, and port-based configuration # server {# listen 8000; # Listen somename: 8080; # SERVER_NAME somename alias another. alias; # location/{# Root HTML; # index index.html index.htm; #}#}# https server # server {# Listen 443; # SERVER_NAME localhost; # SSL on; # ssl_certificate cert. PEM; # ssl_certificate_key cert. key ;# Ssl_session_timeout 5 m; # ssl_protocols SSLv2 SSLv3 tlsv1; # ssl_ciphers all :! ADH :! Export56: RC4 + RSA: + high: + medium: + low: + SSLv2: + exp; # ssl_prefer_server_ciphers on; # location/{# Root HTML; # index index.html index.htm; #}#}}

 

 

After Ubuntu is installed, the file structure is roughly as follows:
Http://wiki.ubuntu.org.cn/Nginx

 

Introduction to IBM nginx
Http://www.ibm.com/developerworks/cn/web/wa-lo-nginx/

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.