Nginx的server块和location块的简单说明
生活随笔
收集整理的這篇文章主要介紹了
Nginx的server块和location块的简单说明
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
server塊和location塊
server塊和location塊都是我們要重點講解和學習的內容,因為我們后面會對Nginx的功能進行詳細講解,所以這塊內容就放到靜態資源部署的地方給大家詳細說明。
本節我們主要來認識下Nginx默認給的nginx.conf中的相關內容,以及server塊與location塊在使用的時候需要注意的一些內容。
server {listen 80;server_name localhost;location / {root html;index index.html index.htm;}error_page 500 502 503 504 404 /50x.html;location = /50x.html {root html;}}總結
以上是生活随笔為你收集整理的Nginx的server块和location块的简单说明的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Nginx的http块其他的配置指令说明
- 下一篇: Nginx基础配置实例需求分析