Home > Operation and Maintenance > Nginx > How to modify Nginx files with centos7 docker

How to modify Nginx files with centos7 docker

王林
Release: 2023-06-01 09:31:07
forward
1381 people have browsed it

1. Docker installation nginx:

Docker installation nginx is still very simple

2. After installation, enter the docker container:

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

centos7 docker修改Nginx文件的方法

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 key point. An error will be reported, as follows

centos7 docker修改Nginx文件的方法

3. It prompts that there is no vim command. Install this command: apt-get install vim

If unsuccessful

centos7 docker修改Nginx文件的方法

Update apt-get command: apt-get update

4. Update completed Then execute the third step command: apt-get install vim

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

centos7 docker修改Nginx文件的方法

3. External request verification:

centos7 docker修改Nginx文件的方法

The above is the detailed content of How to modify Nginx files with centos7 docker. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template