您的位置:首页 > 运维架构 > Nginx

windows上安装配置nginx 1.4.0

2013-05-02 23:13 411 查看
参考http://www.cnblogs.com/mecity/archive/2011/06/17/2082786.html

https://maskv.com/technology/77.html

c:\>cd nginx*

c:\nginx-1.4.0>start nginx

c:\nginx-1.4.0>

===========================

有log信息了:

access.log

127.0.0.1 - - [02/May/2013:22:53:42 +0800] "\xE3}\x00\x00\x00\x01\x10\xDA3\x8E\xFA/\x0E\x13\x06ww\xED\xD9\x1Buo\xF5~d\x00\x00\xFF\xFF\x08\x00\x00\x00\x02\x01\x00\x01\x15\x00[CHN]a1[VeryCD]xthame\x03\x01\x00\x11<\x00\x00\x00\x02\x01\x00U" 400 172 "-" "-"

==================================

输入:

http://localhost/

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.

Commercial support is available at nginx.com.
Thank you for using nginx.
==========================================
http://koda.iteye.com/blog/601249

4. 停止Nginx

Ctrl+C没反应。于是关闭控制台窗口。可是再访问http://localhost依然有效。查看进程,发现nginx根本没有被关闭。因此如果想彻底关闭nginx,应该是

Command代码


nginx -s stop

=======================

nginx.conf

http://www.ckplayer.com/view.php?id=174

http://woyoo.org/linux/nginx-liumeiti.html

#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 html;

index index.html index.htm;

}



location ~ /.flv {

flv;

}

location ~ /.mp4$ {

mp4;

mp4_buffer_size 1m;

mp4_max_buffer_size 5m;

}



#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html

#

error_page 500 502 503 504 /50x.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 html;

# fastcgi_pass 127.0.0.1:9000;

# fastcgi_index index.php;

# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;

# include fastcgi_params;

#}

# deny access to .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 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;

# ssl_ciphers HIGH:!aNULL:!MD5;

# ssl_prefer_server_ciphers on;

# location / {

# root html;

# index index.html index.htm;

# }

#}

}

=========================

http://localhost/%E5%A4%A7%E8%AF%9D%E4%BC%98%E9%85%B7%E3%80%81%E9%85%B7%E5%85%AD%E7%B1%BB%E8%A7%86%E9%A2%91%E7%BD%91%E7%AB%99Android%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91_3%E3%80%81%E8%BD%AF%E4%BB%B6%E7%9A%84%E6%A6%82%E8%BF%B0.mp4

测试可行。



=========================

c:\nginx-1.4.0>nginx -V

nginx version: nginx/1.4.0

TLS SNI support enabled

configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= -

-conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access

.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-te

mp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fast

cgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsg

i-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msv

c8/lib/pcre-8.32 --with-zlib=objs.msvc8/lib/zlib-1.2.7 --with-select_module --wi

th-http_realip_module --with-http_addition_module --with-http_sub_module --with-

http_dav_module --with-http_stub_status_module --with-http_flv_module--with-htt

p_mp4_module
--with-http_gunzip_module --with-http_gzip_static_module --with-htt

p_random_index_module --with-http_secure_link_module --with-mail --with-openssl=

objs.msvc8/lib/openssl-1.0.1e --with-openssl-opt=enable-tlsext --with-http_ssl_m

odule --with-mail_ssl_module --with-ipv6

c:\nginx-1.4.0>

==================

http://nginx.org/en/docs/windows.html

nginx/Windows runs as a standard console application (not a service), and it can be managed using the following commands:

nginx -s stopfast shutdown
nginx -s quitgraceful shutdown
nginx -s reloadchanging configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processes
nginx -s reopenre-opening log files
======================

http://wiki.nginx.org/Install

cd c:\
unzip nginx-1.2.3.zip
ren nginx-1.2.3 nginx
cd nginx
start nginx


Control:

nginx -s [ stop | quit | reopen | reload ]


For problems look in c:\nginx\logs\error.log or in EventLog.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: