How to use nginx to access local static resources on Linux server

How to use nginx to access local static resources on Linux server

1. Check whether port 80 is occupied. Generally, port 80 is occupied by Apache service.

netstat -anp|grep 80

2. Modify the port number of the Apache service

vim /etc/apache2/ports.conf

3. Change the port number to 8080

4. Modify nginx service configuration

vim /etc/nginx/conf.d/nginx.conf

5. Restart nginx service

service nginx restart

6. The page attempts to access local resources

7.Access successful!

Summarize

The above is the method that I introduced to you using nginx to access local static resources on a Linux server. I hope it will be helpful to you!

You may also be interested in:
  • Detailed explanation of solving the problem of cross-domain access of nginx/apache static resources
  • Detailed explanation of Nginx + Tomcat to separate requests for dynamic data and static resources
  • Detailed explanation of simple configuration of nginx static resource server
  • Nginx implements reverse proxy example of static resources
  • Use nginx-http-concat module to merge static resource files in nginx
  • How to publish static resources in nginx

<<:  Detailed explanation of MySQL user and permission management

>>:  How to customize an EventEmitter in node.js

Recommend

How to import Chinese data into csv in Navicat for SQLite

This article shares with you the specific method ...

MySQL slow query log configuration and usage tutorial

Preface MySQL slow query log is a function that w...

Simple encapsulation of axios and example code for use

Preface Recently, when I was building a project, ...

JavaScript uses canvas to draw coordinates and lines

This article shares the specific code of using ca...

4 principles for clean and beautiful web design

This article will discuss these 4 principles as t...

Detailed tutorial on installing Docker on CentOS 7.5

Introduction to Docker Docker is an open source c...

Diagram of the process of implementing direction proxy through nginx

This article mainly introduces the process of imp...

Example of stars for CSS rating effect

What? What star coat? Well, let’s look at the pic...

JavaScript canvas realizes colorful sun halo effect

This article example shares the specific code of ...

A brief discussion on React Component life cycle functions

What are the lifecycle functions of React compone...

Detailed steps to upgrade mysql8.0.11 to mysql8.0.17 under win2008

Upgrade background: In order to solve the vulnera...

Implementation of Nginx configuration Https security authentication

1. The difference between Http and Https HTTP: It...