nginx.conf
:
<code>http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout <span>65</span>; gzip on; upstream localhost { <span>server</span><span>127.0</span><span>.0</span><span>.1</span>:<span>8080</span> max_fails=<span>7</span> fail_timeout=<span>7</span>s; } <span>server</span> { listen <span>81</span>; server_name localhost; location / { root html; <span>index</span><span>index</span>.html <span>index</span>.htm; proxy_pass http:<span>//localhost;</span> } } <span>server</span> { listen <span>80</span>; server_name localhost; <span>#charset koi8-r;</span><span>#access_log logs/host.access.log main;</span> location / { root html; <span>index</span><span>index</span>.html <span>index</span>.htm; proxy_pass http:<span>//localhost;</span> } } }</code>
上記では、複数のポート 80 と 81 を監視する nginx を紹介しました。関連する内容も含めて、PHP チュートリアルに興味のある友人に役立つことを願っています。