ubuntu下搭建nginx+scala+play 2.0运行环境的方法介绍

2020-02-03 10:57:50丽君

  http://apt.typesafe.com/repo-deb-build-0002.deb
1
dpkg -i repo-deb-build-0002.deb
2
 apt-get update
3
 apt-get install sbt
  安装过程中可能需要点时间,完成后测试进入scala目录测试
  sbt
4、启动play2.0项目
1
play
2
start -Dhttp.port=9000
5、nginx设置代理
01   
server
02
        {
03
                listen       80;
04
                server_name *.cn-scala.com cn-scala.com;
05
06
                location /static {
07
                      root     /static/public;
08
                }
09
                location  / {
10
                    proxy_pass    http://127.0.0.1:9000;
11
                    proxy_set_header Host $host;
12
                    proxy_set_header X-Real-IP $remote_addr;
13
                }
14
        }