LoginSignup
10
12

More than 5 years have passed since last update.

Bash on Ubuntu on Windowsでnginxを動かす

Last updated at Posted at 2016-07-05

Windows 10 Insider Preview Build 14379で確認。

インストールはふつうに

sudo apt-get install nginx

で、nginx/1.4.6 がインストールされるはず。(Ubuntu 14.04)

ユーザー www-data (グループ www-data) が存在することを確認

/etc/nginx/nginx.conf の設定

user www-data;
master_process off; # この行を追加
worker_processes 4;
pid /run/nginx.pid;

# 以下省略

/etc/nginx/sites-available/default の設定

server {
        listen 8080 default_server; # ポート番号は空いているところに適当に割り当てる
        # listen [::]:80 default_server ipv6only=on; # ipv6の設定はコメントアウトする

        # 以下省略
}

というわけで、master processの設定とipv6の設定を変えるのがポイント。

(補足)nginxのFAQには「プロダクション環境ではmaster_processをoffにするな」と書いてあるわけですが、Bash on Ubuntu on Windows自体が開発者用機能であり、本番稼働のためのものではないということに留意しましょう。

10
12
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
10
12