start new:
tmux
start new with session name:
tmux new -s myname
[V=browser-hello.mp4] Hi, I'm Matthew from OpenResty Inc. In this video, I'll demonstrate how to implement a "hello world" HTTP interface using OpenResty. | |
First of all, we make sure we are using OpenResty's nginx. | |
[delay=0] $ export PATH=/usr/local/openresty/nginx/sbin:$PATH | |
$ which nginx | |
[S] It's usually in this path. | |
And then we go to the home directory. |
require 'sinatra' # gem install sinatra --no-rdoc --no-ri | |
set :port, 3000 | |
set :environment, :production | |
html = <<-EOT | |
<html><head><style> | |
#text{width:100%; font-size: 15px; padding: 5px; display: block;} | |
</style></head><body> | |
<input id="text" placeholder="Write then press Enter."/> | |
<div id="chat"></div> |
require 'sinatra' # gem install sinatra --no-ri --no-rdoc | |
set :port, 3000 | |
html = <<-EOT | |
<html><head><style> | |
#regex,#text{ width:100%; font-size:15px; display:block; margin-bottom:5px; } | |
#text{ height: 200px; } | |
span{ background:rgb(230,191,161); display:inline-block; border-radius:3px;} | |
</style></head><body> | |
<input id="regex" placeholder="Regex"/> |
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
# This module "secure-link" helps you to protect links from stealing away. | |
# | |
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
cd /usr/src | |
wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |