程序员的套路,任何语言的第一个服务,都是‘Hello world’,我们也来搞一个Hello world服务。
5.1 第一个Hello world 服务
修改默认html文件
/usr/local/nginx/html/index.html
<!DOCTYPE html>
<html>
<head>
<title>Welcome to OpenResty!</title>
</head>
<body>
<h1>Welcome to OpenResty!</h1>
<p><em>hello world</em></p >
</body>
</html>
定义默认serverName
/usr/loca/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm index.php;
}
}
说明:
- 每个nginx服务都会有默认的s