Detailed explanation of putting common nginx commands into shell scripts

Detailed explanation of putting common nginx commands into shell scripts

1. Create a folder to store nginx shell scripts

 /usr/local/task/nginx

1) Restart nginx shell script
vim reload.sh

#!/bin/bash
nginx -s reload

2) Set the shell script for the nginx user to read, write and execute permissions for all files in the html directory
vim setfacl.sh

#!/bin/bash
setfacl -mu:nginx:rwx -R /usr/local/nginx/html/
setfacl -md:u:nginx:rwx -R /usr/local/nginx/html/

3) Shell script to start the nginx process
vim start.sh

#!/bin/bash
nginx

4) Shell script to stop nginx process
vim stop.sh

#!/bin/bash
nginx -s stop

2. Use

1) Add execution permissions to the nginx shell script

chmod -R 755 /usr/local/task/nginx

2) Execute the start.sh script

/usr/local/task/nginx/start.sh 

This is the end of this article about the detailed explanation of putting commonly used nginx commands into shell scripts. For more relevant content about putting nginx commands into shell scripts, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed process of installing nginx with shell script source code
  • Shell script nginx automation script
  • How to install nginx under Linux
  • Example of implementing nginx self-starting script under centos/rhel
  • Shell script to install Nginx service and customize Nginx version in one click

<<:  MySQL implements string concatenation, interception, replacement, and position search operations

>>:  Vue implements the digital thousands separator format globally

Recommend

Implementation steps for docker-compose to deploy etcd cluster

Table of contents Write docker-compose.yml Run do...

Embed player in web page embed element autostart false invalid

Recently, I encountered the need to embed a player...

Detailed explanation of how to migrate a MySQL database to another machine

1. First find the Data file on the migration serv...

How to view version information in Linux

How to view version information under Linux, incl...

Implementation of CSS equal division of parent container (perfect thirds)

The width of the parent container is fixed. In or...

Example of how to upload a Docker image to a private repository

The image can be easily pushed directly to the Do...

Implementation of mysql data type conversion

1. Problem There is a table as shown below, we ne...

HTML table markup tutorial (18): table header

<br />The header refers to the first row of ...

MySQL 8.0.13 download and installation tutorial with pictures and text

MySQL is the most commonly used database. You mus...

Website construction experience summary

<br />What principles should be followed to ...