日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

Nginx —— 用HTTP核心模块配置一个静态的Web服务器

發(fā)布時間:2025/10/17 Nginx 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Nginx —— 用HTTP核心模块配置一个静态的Web服务器 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

靜態(tài)Web服務(wù)器的主要功能有NGX_HTTP_CORE_MODULE模塊(HTTP框架的主喲奧成員)實現(xiàn),當(dāng)然,一個完整的靜態(tài)Web服務(wù)器還有許多功能由其他的HTTP模塊實現(xiàn)。

1》Web服務(wù)器的地址: 192.168.1.210
2》Web服務(wù)器端設(shè)置nginx的conf文件內(nèi)容:

[root@localhost conf]# cat nginx.conf | grep -v '#'worker_processes 1;events {worker_connections 1024; }http {include mime.types;default_type application/octet-stream;sendfile on;keepalive_timeout 65;server {listen 8080;server_name localhost;location / {root html;index index.html index.htm;}error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}} }

3》啟動nginx服務(wù)器(找到nginx的二進制文件):

[root@localhost conf]# /usr/local/nginx/sbin/nginx

查找方式:# whereis? nginx? (會顯示 nginx的安裝路徑)

4》查看是否啟動成功:

[root@localhost conf]# ps -aux | grep nginx root 34848 0.0 0.0 20748 1404 ? Ss 19:46 0:00 nginx: master process /usr/local/nginx/sbin/nginx nobody 35739 0.0 0.0 23284 1768 ? S 20:52 0:00 nginx: worker process root 35749 0.0 0.0 112720 984 pts/1 S+ 20:54 0:00 grep --color=auto nginx

5》客戶端測試地址: 192.168.1.93

打瀏覽器地址欄輸入: http://192.168.1.210:8080/

注意: 這里一定要加conf文件中監(jiān)聽的端口,否則http默認(rèn)監(jiān)聽80端口。

6》顯示的頁面內(nèi)容:

[root@localhost sbin]# cat ../html/index.html <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style>body {width: 35em;margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;} </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p><p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p> </body> </html>

?

?

?

?

?注意:? Nginx —— nginx服務(wù)的基本配置(nginx.conf文件的詳解)

總結(jié)

以上是生活随笔為你收集整理的Nginx —— 用HTTP核心模块配置一个静态的Web服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。