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

How to modify Nginx files with centos7 docker

王林
王林forward
2023-06-01 09:31:071347browse

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete