Home > Article > Operation and Maintenance > How to use docker to modify Nginx files
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.
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
3. It prompts that there is no vim command. Install this command: apt-get install vim
If unsuccessful
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
3. External request verification:
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!