linux 服务器常用脚本
(1)nginx
重新加载配置文件:
reload.sh :
#!/bin/sh /usr/local/nginx/sbin/nginx -s reload
启动nginx:
#!/bin/sh /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
域名转发:
/usr/local/nginx/vhosts/blog.hbjltv.com.conf
server {
listen 80;
server_name blog.hbjltv.com;
# rewrite ^/yhyc/(.*)$ http://www.yhskyc.com/$1 ;
location / {
proxy_pass http://hbjltv.com:8084/convention2/;
# proxy_redirect off ;
index index.php index.html index.htm;
}
location /convention2/ {
proxy_pass http://hbjltv.com:8084/convention2/;
# proxy_redirect off ;
#
# # index index.php index.html index.htm;
# }
error_page 500 502 503 504 /50x.html;
}
location /convention/upload/ {
proxy_pass http://hbjltv.com:8084/convention2/upload/;
}
}
(3)在重定向到文件的同时显示在控制台
使用 tee -a
java -Dapp.home=$DEPLOY_DIR $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS $APP_MAINCLASS 2>&1 |tee -a $STDOUT_FILE

本文介绍了一组用于 Linux 服务器上的 Nginx 的实用脚本及配置方法,包括如何重新加载配置文件、启动 Nginx 服务以及进行域名转发等操作。通过这些脚本可以有效地管理和维护 Nginx 服务器。
1003

被折叠的 条评论
为什么被折叠?



