1. 머리말
2. . nginx 다운로드 http://nginx .org/en/download.html 현재 안정 버전은 1.80입니다.
<code><span>#user nobody;</span> worker_processes <span>1</span>; <span>#error_log logs/<span>error</span>.log;</span><span>#error_log logs/<span>error</span>.log notice;</span><span>#error_log logs/<span>error</span>.log info;</span><span>#pid logs/nginx.pid;</span>events { worker_connections <span>1024</span>; } http { include mime.types; default_type application/octet-stream; <span>#log_format main '$remote_addr - $remote_user [$time_local] "$request" '</span><span># '$status $body_bytes_sent "$http_referer" '</span><span># '"$http_user_agent" "$http_x_forwarded_for"';</span><span>#access_log logs/access.log main;</span> sendfile on; <span>#tcp_nopush on;</span><span>#keepalive_timeout 0;</span> keepalive_timeout <span>65</span>; <span>#gzip on;</span> server { listen <span>8080</span>; server_name localhost; <span>#charset koi8-r;</span><span>#access_log logs/host.access.log main;</span> location / { <span>#root html;</span><span>#index index.html index.htm;</span><span>if</span> ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){ add_header Content-Disposition: <span>'attachment;'</span>; } } <span>#error_page 404 /404.html;</span><span># redirect server <span>error</span> pages to the static page /50x.html</span><span>#</span> error_page <span>500</span><span>502</span><span>503</span><span>504</span> /<span>50</span>x.html; location = /<span>50</span>x.html { root html; } } }</code>디렉토리 아래의 html에 test 및 test.rar 파일을 생성합니다. 4. 명령줄을 열고 nginx 디렉토리