This is a sample sinatra application working with thin and nginx.
-
bundle install
-
Include
config/nginx.conf
in your mainnginx.conf
. E.g.include /d/bb/nginx_thin_sinatra_hello_world/config/nginx.conf;
-
Start server
./bin/start
Best way to start the development server:
bundle exec rerun "rackup -s thin -p 5555 config.ru"
Use helper scripts in bin
directory
start
to start thin clusterstop
to stop thin clusterrestart
to restart thin cluster
All script must be run from the root directory, e.g: ./bin/start
Use the following command to test your sinatra app. The host must be configured in Nginx.
-
Static resource:
curl -H 'Host: app.com' localhost/hello.txt
-
Dynamic resource:
curl -H 'Host: app.com' localhost