# 有3个参数,第一个是配置文件名,第二个是tomcat端口,第三个是工程名字 # 执行命令如下,可以在notepad++里面批量生成执行命令: bash -x a_auto_tomcat.sh bright_tomcat.conf 8000 PLATFORM_AUTH_Service bash -x a_auto_tomcat.sh bright_tomcat.conf 8000 PLATFORM_SSO_Service bash -x a_auto_tomcat.sh bright_tomcat.conf 8100 PLATFORM_SSO_Web bash -x a_auto_tomcat.sh bright_tomcat.conf 8100 PLATFORM_AUTH_Web bash -x a_auto_tomcat.sh bright_tomcat.conf 8100 PLATFORM_MANAGER_Web bash -x a_auto_tomcat.sh bright_tomcat.conf 8200 PLATFORM_MANAGER_Web …… # 执行结束后,会看到生成的location文件,如下所示: [nginx@dev_121_21 conf]$ more bright_tomcat.conf location ~* ^/PLATFORM_AUTH_Service/.*$ { include deny.conf; proxy_pass http://PLATFORM_AUTH_Service_8000; error_log logs/PLATFORM_AUTH_Service_access.log error; access_log logs/PLATFORM_AUTH_Service_error.log sso; } location ~* ^/PLATFORM_SSO_Service/.*$ { include deny.conf; proxy_pass http://PLATFORM_SSO_Service_8000; error_log logs/PLATFORM_SSO_Service_access.log error; access_log logs/PLATFORM_SSO_Service_error.log sso; } location ~* ^/PLATFORM_SSO_Web/.*$ { include deny.conf; proxy_pass http://PLATFORM_SSO_Web_8100; error_log logs/PLATFORM_SSO_Web_access.log error; access_log logs/PLATFORM_SSO_Web_error.log sso; } location ~* ^/PLATFORM_AUTH_Web/.*$ { include deny.conf; proxy_pass http://PLATFORM_AUTH_Web_8100; error_log logs/PLATFORM_AUTH_Web_access.log error; access_log logs/PLATFORM_AUTH_Web_error.log sso; } |