1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Scala Play Framework (Play2) を nginxから呼ぶ

1
Posted at

Scala Play2 を起動
ngin を起動
って感じで、別々の起動まではやったので Play2をnginxから呼ぶようにする。

1. nginx の設定追加

これであってるのかよくわかってないけど。。
/etc/nginx/conf.d/scala_play.conf
って設定ファイルを作成してみた。

# vim /etc/nginx/conf.d/scala_play.conf

中身は下記↓

upstream scala_play {
    server 127.0.0.1:9000;
}

server {
    listen      80;
    server_name xxxxx.com;

    root  /var/www/project-name;

    location / {
        proxy_pass http://scala_play;
    }
}

2. nginx 再起動

# systemctl restart nginx

3. play2 起動

# cd /var/www/project-name
# activator run

起動後、ブラウザで「xxxxx.com」にアクセスし、welcome画面が表示されればOK。

welcome_play.jpg

1
4
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
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?