How to use docker to modify Nginx files

王林
Release: 2023-05-19 15:52:06
forward
1784 people have browsed it

1. Install nginx with docker:

It is very simple to install nginx with docker. You can refer to this official website article

2. After installation, enter the docker container:

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

How to use docker to modify Nginx files

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

How to use docker to modify Nginx files

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

If unsuccessful

How to use docker to modify Nginx files

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

How to use docker to modify Nginx files

3. External request verification:

How to use docker to modify Nginx files

The above is the detailed content of How to use docker to modify Nginx files. 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