Detailed explanation of the process of modifying Nginx files in centos7 docker

Detailed explanation of the process of modifying Nginx files in centos7 docker

1. Install nginx in docker:

It is very simple to install Nginx in docker. You can refer to Baidu article, or refer to docker to install mysql:

https://www.jb51.net/article/144426.htm

2. After installation, enter the docker container:

Execute command: docker exec -it container id bash . Note that the container must be open to access.

3. Take modifying nginx's index.html as an example:

1. Enter the directory where index is located: cd usr/share/nginx/html

2. Edit index.html. Here comes the error, as follows

3. If there is no vim command, install it: apt-get install vim

If unsuccessful

Update apt-get command: apt-get update

4. After the update, execute the third step command: apt-get install vim

5. After the vim command is successfully imported, enter /usr/share/nginx/html and execute: vim index.html

3. External request verification:

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Centos7.3 How to install and deploy Nginx and configure https
  • How to add Nginx to system services in CentOS7
  • How to install Nginx in CentOS7 and configure automatic startup
  • Tutorial on installing lnmp using yum on centos7 (linux+nginx+php7.1+mysql5.7)
  • Centos7 restart apache, nginx, mysql, php-fpm command method
  • How to build a private server in docker (docker-registry with nginx&ssl on centos)
  • Solution to the problem that docker nginx cannot be accessed after running

<<:  How to implement a multi-terminal bridging platform based on websocket in JS

>>:  MySQL 8.0.11 MacOS 10.13 installation and configuration method graphic tutorial

Recommend

【HTML element】How to embed images

The img element allows us to embed images in HTML...

Implementation of Docker private library

Installing and deploying a private Docker Registr...

Docker cleaning killer/Docker overlay file takes up too much disk space

[Looking at all the migration files on the Intern...

How to generate PDF and download it in Vue front-end

Table of contents 1. Installation and introductio...

Tutorial diagram of installing TomCat in Windows 10

Install TomCat on Windows This article will intro...

In-depth analysis of MySQL index data structure

Table of contents Overview Index data structure B...

Solution for VMware Workstation Pro not running on Windows

After the National Day holiday, did any of you fi...

Mysql 5.7.18 Using MySQL proxies_priv to implement similar user group management

Use MySQL proxies_priv (simulated role) to implem...

Solution to MySQL restarting automatically

Preface Recently, a problem occurred in the test ...

Front-end vue+express file upload and download example

Create a new server.js yarn init -y yarn add expr...

Detailed introduction to CSS priority knowledge

Before talking about CSS priority, we need to und...

Introduction to Vue life cycle and detailed explanation of hook functions

Table of contents Vue life cycle introduction and...

JS cross-domain solution react configuration reverse proxy

Cross-domain solutions jsonp (simulate get) CORS ...

Solution to data duplication when using limit+order by in MySql paging

Table of contents summary Problem Description Ana...