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

Vue implements Dialog encapsulation

Table of contents Vue2 Writing Vue3 plugin versio...

How to install Nginx in CentOS

Official documentation: https://nginx.org/en/linu...

MySQL 8.0.18 installation and configuration graphic tutorial

Learning objectives: Learn to use Windows system ...

Detailed explanation of nginx installation, deployment and usage on Linux

Table of contents 1. Download 2. Deployment 3. Ng...

Rainbow button style made with CSS3

Result: Implementation code: html <div class=&...

MySQL Series II Multi-Instance Configuration

Tutorial Series MySQL series: Basic concepts of M...

How to solve the 2002 error when installing MySQL database on Alibaba Cloud

The following error occurred while installing the...

Basic implementation method of cross-component binding using v-model in Vue

Hello everyone, today we will talk about how to u...

A Brief Analysis of MySQL Connections and Collections

Join query A join query refers to a matching quer...

MySQL database implements MMM high availability cluster architecture

concept MMM (Master-Master replication manager fo...

MySQL Packet for query is too large problem and solution

Problem description: Error message: Caused by: co...