step
Practical operationPut the published static web pages into the specified folder: Change the nginx configuration file: The nginx.conf configuration content is as follows: #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { gzip on; #Static file server { listen 8080; server_name localhost; location / { root D:/resources/statichtmls; } } #html file server { listen 8080; server_name 127.0.0.1 localhost; location / { root D:/resources/statichtmls; index index.html index.htm; } } } Start nginx: Check whether the release is successful If it fails, please check the port number or other configurations, and whether the static file is correct. Shutdown nginxAfter the test is completed, if you do not use it, remember to close nginx The next time I enter the system, I cannot log in, which means nginx is closed. This is the end of this article about how to publish static resources with nginx. For more information about how to publish static resources with nginx, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: WeChat applet development form validation WxValidate usage
>>: 4 ways to avoid duplicate insertion of data in Mysql
1. Background 1. The front end uses vue + vuex + ...
<br />Years of professional art design educa...
Sometimes we may encounter such a requirement, th...
First, open the virtual machine Open xshell5 to c...
Preface By default, MySQL will initialize a large...
Preface I recently learned Linux, and then change...
1. First enter the server's mysql to modify p...
As a lightweight open source database, MySQL is w...
Table of contents 1. Introduction 2. Prepare the ...
Share a Shell script under Linux to monitor the m...
Since I have changed to a new computer, all the e...
First, take a look at Alibaba Cloud's officia...
Table of contents Preface 1. Understanding with e...
This article shares the specific code of node+exp...
Table of contents Error message Cause Error demon...