Home > Article > Backend Development > PHP management nginx virtual host shell script_PHP tutorial
It is very convenient to use php as a shell script. Of course, we can use php scripts to manage nginx virtual hosts. Below is the author’s script file for your reference
代码如下 | |
#!/usr/bin/php -q |
The following is the configuration template of nginx
The code is as follows
|
|||||
server { listen 80; access_log off; }location = / {
try_files @proxy;
}
location / { index index.htm index.html index.php; try_files \$uri @proxy; } #matchhtml location ~* \.(html|htm)$ { expires 30s; gzip off; add_header Content-Encoding gzip; try_files \$uri \$uri/ /wp-content/cache/supercache/\$http_host/\$request_uri/index.html.gz @proxy; } #Match images, script files, etc. location ~* \.(jpe?g|gif|png|ico|css|js|flv|swf|avi|zip|rar|svg|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt| txt|tar|mp3)$ { expires 30d; } # Passed to apache location @proxy { index index.htm index.html index.php; proxy_pass http://127.0.0.1:81; include /etc/nginx/proxy.conf; } } http://www.bkjia.com/PHPjc/898889.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/898889.htmlTechArticlephp management nginx virtual host shell script It is very convenient to use php as the shell script. Of course, we can use php scripts to manage nginx virtual hosts. The following is the author's... |