LoginSignup
6
8

More than 5 years have passed since last update.

Windows10でnginx起動 ローカル開発環境構築

Last updated at Posted at 2015-09-04

大まかな流れ

  1. ダウンロード
  2. 設定ファイル編集
  3. 起動

ダウンロード

公式サイト から最新版のzipをDLし、ローカルに解凍する。
例)c:\nginx

設定ファイル編集

c:\nginx\conf\nginx.confを編集する。

まず、ルートディレクトリを指定する。
このとき、rootのパスの最後にスラッシュを入れること。


location / {
    root   c:/mapplus/branches/app_web/;
    index  index.html index.htm;
}

apache等別のWebサーバが動作していて"localhost"がかち合うときは、
バーチャルホストの設定を見直す。以下、"localsys"にした例。


server {
    server_name  localsys;
}

このときhostsファイルの書き換えも忘れずに。
hostsを開いて、最後の行に「127.0.0.1 localsys」を記述して保存。

起動

c:\nginx\nginx.exeをクリック。
再起動は、コマンドプロンプトから次のコマンドを叩く。


c:\nginx>nginx -s reload

参考・引用したサイト

ngnixをローカル環境のwindows7にインストールする方法を図解付きで解説。XAMPPとの併用も。

6
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
8