Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of nginx virtual host configuration example

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Nginx virtual host configuration

Server {listen 80; server_name localhost; location / {root html; index index.html index.htm;} error_page 404 / 404.html; # redirect server error pages to the static page / 50x.html # error_page 500502 503504 / 50x.hml; location = / 50x.html {root html;}}

Configuration instructions:

Listen 80; = > specifies that the virtual host listens on port 80

Server_name localhost; = > specify the virtual host domain name

Location / {...} = > matches the request path, / indicates that all requests are matched

Root html; = > specify the physical root directory of the virtual host, and the physical root directories of eg and html are located at D:\ div\ nginx-1.9.14\ html\

Index index.html index.htm; = > specify the default home page of the virtual host, which is located in the D:\ div\ nginx-1.9.14\ html directory

Thank you for reading, hope to help you, thank you for your support to this site!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report