下載地址 http://nginx.org/en/download.html 選擇windows版本
下載後檔案目錄結構如下圖
worker_processes 1;#工作进程数 events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80;#监听80端口 server_name 域名; location / { proxy_pass http://127.0.0.1:8080/xxx/index.jsp;#需要代理的本地资源 proxy_cookie_path / /; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { proxy_pass http://127.0.0.1:8080; } location ~ .*\.(js|css)$ { proxy_pass http://127.0.0.1:8080; } } include xxx.conf;#引用外部配置文件 }
以上就介紹了windows環境下使用nginx,包含了Windows方面的內容,希望對PHP教學有興趣的朋友有幫助。