linux.conf

  1. user root;
  2. worker_processes ;
  3.  
  4. #error_log logs/error.log;
  5. #error_log logs/error.log notice;
  6. #error_log logs/error.log info;
  7.  
  8. #pid logs/nginx.pid;
  9.  
  10. events {
  11. worker_connections ;
  12. }
  13.  
  14. http {
  15. include mime.types;
  16. default_type application/octet-stream;
  17.  
  18. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  19. # '$status $body_bytes_sent "$http_referer" '
  20. # '"$http_user_agent" "$http_x_forwarded_for"';
  21.  
  22. #access_log logs/access.log main;
  23.  
  24. sendfile on;
  25. #tcp_nopush on;
  26.  
  27. #keepalive_timeout ;
  28. keepalive_timeout ;
  29.  
  30. #gzip on;
  31.  
  32. server {
  33. listen ;
  34. server_name 0.0.0.0;
  35.  
  36. #charset utf-;
  37.  
  38. #charset koi-utf;
  39.  
  40. autoindex on;
  41.  
  42. autoindex_exact_size off;
  43.  
  44. autoindex_localtime on;
  45.  
  46. #access_log logs/host.access.log main;
  47.  
  48. location / {
  49. root ../path//web/dist/web;
  50. error_page /;
  51. }
  52.  
  53. location /fang {
  54. root /home/fang-site/www;
  55. error_page /fang/;
  56. }
  57.  
  58. location /mirrors {
  59. root /home/fang-site/www;
  60. }
  61.  
  62. location /j-lunker {
  63. root /home/fang-site/j-lunker/www/;
  64.  
  65. # redirection config for ngx-perfect-scrollbar
  66. rewrite ngx-perfect-scrollbar/dist/ngx-perfect-scrollbar\.js /j-lunker/node_modules/ngx-perfect-scrollbar/dist/index.js;
  67. rewrite ngx-perfect-scrollbar/dist/index$ /j-lunker/node_modules/ngx-perfect-scrollbar/dist/index.js;
  68. rewrite ngx-perfect-scrollbar/dist/lib/index$ /j-lunker/node_modules/ngx-perfect-scrollbar/dist/lib/index.js;
  69. rewrite ngx-perfect-scrollbar/dist/lib/(perfect-scrollbar\.\w+)$ /j-lunker/node_modules/ngx-perfect-scrollbar/dist/lib/$.js;
  70.  
  71. # redirection config for perfect-scrollbar
  72. rewrite /j-lunker/node_modules/perfect-scrollbar/(.*) /j-lunker/node_modules/ngx-perfect-scrollbar/node_modules/perfect-scrollbar/$;
  73.  
  74. # redirection config for rxjs
  75. rewrite rxjs/operators/index.js /j-lunker/node_modules/rxjs/operators.js;
  76. rewrite rxjs/operators/(\w+/\w+\.js.*) /j-lunker/node_modules/rxjs/$;
  77. rewrite rxjs/operators/([A-Z]\w+\.js.*) /j-lunker/node_modules/rxjs/$;
  78.  
  79. # redirection config for @ngx-translate
  80. rewrite @ngx-translate/core/src/(translate\.\w+)$ /j-lunker/node_modules/@ngx-translate/core/src/$.js;
  81. rewrite @ngx-translate/core/index$ /j-lunker/node_modules/@ngx-translate/core/index.js;
  82. rewrite @ngx-translate/core/src/util$ /j-lunker/node_modules/@ngx-translate/core/src/util.js;
  83. rewrite @ngx-translate/core/src/missing-translation-handler$ /j-lunker/node_modules/@ngx-translate/core/src/missing-translation-handler.js;
  84. }
  85.  
  86. try_files $uri $uri/ /index.html?$args;
  87.  
  88. # redirect server error pages to the static page /50x.html
  89. #
  90. error_page /50x.html;
  91. location = /50x.html {
  92. root html;
  93. }
  94.  
  95. location /rdk/service {
  96. proxy_pass http://10.11.111.88:30000;
  97. }
  98.  
  99. location /file-upload/service {
  100. proxy_pass http://10.11.111.88:3800;
  101. }
  102.  
  103. location /xplan {
  104. proxy_pass http://10.11.111.88:40000;
  105. }
  106.  
  107. location /test/fang-resource{
  108. root /home/fang;
  109. #auth_basic "please input password:";
  110. #auth_basic_user_file F:/.htpasswd;
  111. }
  112.  
  113. #文件上传存放路径,及ux资源实时打包存放路径
  114. location /fang-file{
  115. root /home/fang;
  116. autoindex off;
  117. }
  118.  
  119. # proxy the PHP scripts to Apache listening on 127.0.0.1:
  120. #
  121. #location ~ \.php$ {
  122. # proxy_pass http://127.0.0.1;
  123. #}
  124.  
  125. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
  126. #
  127. #location ~ \.php$ {
  128. # root html;
  129. # fastcgi_pass 127.0.0.1:;
  130. # fastcgi_index index.php;
  131. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  132. # include fastcgi_params;
  133. #}
  134.  
  135. # deny access to .htaccess files, if Apache's document root
  136. # concurs with nginx's one
  137. #
  138. #location ~ /\.ht {
  139. # deny all;
  140. #}
  141. }
  142.  
  143. # another virtual host using mix of IP-, name-, and port-based configuration
  144. #
  145. #server {
  146. # listen ;
  147. # listen somename:;
  148. # server_name somename alias another.alias;
  149.  
  150. # location / {
  151. # root html;
  152. # index index.html index.htm;
  153. # }
  154. #}
  155.  
  156. # HTTPS server
  157. #
  158. #server {
  159. # listen ssl;
  160. # server_name localhost;
  161.  
  162. # ssl_certificate cert.pem;
  163. # ssl_certificate_key cert.key;
  164.  
  165. # ssl_session_cache shared:SSL:1m;
  166. # ssl_session_timeout 5m;
  167.  
  168. # ssl_ciphers HIGH:!aNULL:!MD5;
  169. # ssl_prefer_server_ciphers on;
  170.  
  171. # location / {
  172. # root html;
  173. # index index.html index.htm;
  174. # }
  175. #}
  176.  
  177. }

stop.sh

  1. #!/bin/sh
  2. DIRNAME=`dirname $`
  3. HOME=`cd $DIRNAME/; pwd`
  4. UMS_HOME=`cd $DIRNAME/../../; pwd`
  5.  
  6. _NGINXCMD="$HOME/nginx-linux-x86_32"
  7.  
  8. OSNAME=`uname`
  9.  
  10. if [ $OSNAME = "Linux" ]; then
  11. PLATFORM=`uname -p`
  12. if [ $PLATFORM = "x86_64" ] ;then
  13. _NGINXCMD="$HOME/nginx-linux-x86_64"
  14. else
  15. _NGINXCMD="$HOME/nginx-linux-x86_32"
  16. fi
  17. fi
  18. if [ $OSNAME = "AIX" ] ;then
  19. _NGINXCMD="$HOME/nginx-aix"
  20. fi
  21.  
  22. if [ $OSNAME = "SunOS" ] ;then
  23. OSNAME2=`uname -m`
  24. if [ $OSNAME2 = "i86pc" ]; then
  25. _NGINXCMD="$HOME/nginx-solaris-x86"
  26. else
  27. _NGINXCMD="$HOME/nginx-solaris-sparc"
  28. fi
  29. fi
  30.  
  31. echo ===============================================================================
  32. echo HOME=$HOME
  33. echo _NGINXCMD=$_NGINXCMD
  34. echo ===============================================================================
  35.  
  36. cd $HOME; pwd
  37.  
  38. echo @WORK_DIR@ $HOME
  39. echo @C_CMD@
  40.  
  41. nginx_id=`ps -ef | grep nginx | grep $_NGINXCMD | grep -v grep | awk '{print $2}'`
  42. echo $nginx_id
  43. worker_id_list=`ps -ef | grep nginx | grep $nginx_id | grep "worker process" | awk '{print $2}'`
  44. echo $worker_id_list
  45.  
  46. $_NGINXCMD -p $HOME/ -s stop
  47. ps -p $nginx_id
  48. if [ $? -eq ]; then
  49. kill - $nginx_id
  50. fi
  51.  
  52. for worker_id in $worker_id_list
  53. do
  54. ps -p $worker_id
  55. if [ $? -eq ]; then
  56. echo kill - $worker_id
  57. kill - $worker_id
  58. fi
  59. done

run.sh

  1. #!/bin/sh
  2. DIRNAME=`dirname $`
  3. HOME=`cd $DIRNAME/; pwd`
  4. UMS_HOME=`cd $DIRNAME/../../; pwd`
  5.  
  6. _NGINXCMD="$HOME/nginx-linux-x86_32"
  7.  
  8. OSNAME=`uname`
  9.  
  10. if [ $OSNAME = "Linux" ]; then
  11. PLATFORM=`uname -p`
  12. if [ $PLATFORM = "x86_64" ] ;then
  13. _NGINXCMD="$HOME/nginx-linux-x86_64"
  14. else
  15. _NGINXCMD="$HOME/nginx-linux-x86_32"
  16. fi
  17. fi
  18. if [ $OSNAME = "AIX" ] ;then
  19. _NGINXCMD="$HOME/nginx-aix"
  20. fi
  21.  
  22. if [ $OSNAME = "SunOS" ] ;then
  23. OSNAME2=`uname -m`
  24. if [ $OSNAME2 = "i86pc" ]; then
  25. _NGINXCMD="$HOME/nginx-solaris-x86"
  26. else
  27. _NGINXCMD="$HOME/nginx-solaris-sparc"
  28. fi
  29. fi
  30.  
  31. echo ===============================================================================
  32. echo HOME=$HOME
  33. echo _NGINXCMD=$_NGINXCMD
  34. echo ===============================================================================
  35.  
  36. cd $HOME; pwd
  37.  
  38. echo @WORK_DIR@ $HOME
  39. echo @C_CMD@
  40. $_NGINXCMD -p $HOME/

update.sh

  1. #!/bin/sh
  2.  
  3. echo "ued updating.......";
  4. sleep ;
  5.  
  6. cd $;
  7. git reset HEAD .;
  8. git checkout .;
  9. git clean -xdf;
  10. git checkout master;
  11. git pull;
  12.  
  13. echo "code already update!";
  14.  
  15. node $"/main.js";
  16.  
  17. echo "ued content already update!";
  18.  
  19. git add -A;
  20. git commit -m 'Add Project Success';
  21. git push origin master;
  22.  
  23. echo "The file has been completed simultaneously!";

window  run.bat

  1. echo on
  2. title
  3. @if not "%ECHO%" == "" echo %ECHO%
  4. @if "%OS%" == "Windows_NT" setlocal
  5.  
  6. set DIRNAME=.
  7.  
  8. if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
  9.  
  10. set ARGS=
  11. :loop
  12. if [%] == [] goto endloop
  13. set ARGS=%ARGS% %
  14. shift
  15. goto loop
  16. :endloop
  17.  
  18. set HOME=%DIRNAME%
  19. set _NGINXCMD=%DIRNAME%nginx.exe
  20.  
  21. echo ===============================================================================
  22. echo HOME=%HOME%
  23. echo ===============================================================================
  24.  
  25. cd /d "%HOME%"
  26. echo @WORK_DIR@%HOME%
  27. echo @C_CMD@
  28. "%_NGINXCMD%"

window stop.bat

  1. echo on
  2. title
  3. @if not "%ECHO%" == "" echo %ECHO%
  4. @if "%OS%" == "Windows_NT" setlocal
  5.  
  6. set DIRNAME=.
  7.  
  8. if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
  9.  
  10. set ARGS=
  11. :loop
  12. if [%] == [] goto endloop
  13. set ARGS=%ARGS% %
  14. shift
  15. goto loop
  16. :endloop
  17.  
  18. set HOME=%DIRNAME%
  19. set _NGINXCMD=%DIRNAME%nginx.exe
  20.  
  21. echo ===============================================================================
  22. echo HOME=%HOME%
  23. echo ===============================================================================
  24.  
  25. cd /d "%HOME%"
  26. echo @WORK_DIR@%HOME%
  27. echo @C_CMD@
  28.  
  29. "%_NGINXCMD%" -s stop

linux 前端部署的更多相关文章

  1. Linux项目部署发布

    Linux项目部署发布 1.部署环境准备,准备python3和虚拟环境解释器,virtualenvwrapper pip3 install -i https://pypi.douban.com/sim ...

  2. 以self-contained方式在Linux上部署ASP.NET Core站点

    今天准备将一个在Windows上用VS2015开发的ASP.NET Core程序部署到阿里云Linux服务器上,部署时发现这台服务器是内网服务器,无法直接安装.NET Core SDK,于是想到尝试用 ...

  3. Linux下部署FTP服务器

    Linux下部署FTP服务器 下载安装包 在这里介绍的是离线部署FTP,首先下载对应的rpm包,下载链接为: 下载vsftpd服务 下载FTP客户端 安装ftp服务器 关闭防火墙 service ip ...

  4. Linux系统部署体验中心

    Linux系统部署体验中心 安装Linux虚拟机 1.  下载安装VMware,安装64位Linux系统(Ubuntu),要求:CPU双核,2G内存,60G硬盘 2.  安装系统时,选择安装ssh服务 ...

  5. linux下部署项目问题

    1. 今天linux下部署thinkphp项目,数据库用的mysql. 页面其他都是正常的,但是从数据库中取出的数据都是乱码.最后查了资料 解决方案: 在ThinkPHP里面 Library\Thin ...

  6. linux 下部署nodejs(两种方式)

    本次博客的编写时用的系统环境,刚装好的Centos 6.4  64位虚拟机. 另外关于linux 其他系统的安装 可以参考https://github.com/joyent/node/wiki/Ins ...

  7. Linux下部署Symfony2对app/cache和app/logs目录的权限设置

    在linux下部署完Symfony2,可能在访问的时候会报app/logs或者app/cache目录没有写权限的错误.在linux下,如果我们在命令行登陆的用户和web应用服务器(apache.ngi ...

  8. Linux中部署JAVA程序

    JAVA程序在开发完成后,需要部署到服务器,如果是WEB项目,需要部署到WEB服务器,否则部署到应用服务器. JAVA是跨平台的编程语言,服务器的操作系统可以是Windows.Linux或者其它,下面 ...

  9. Linux系统部署规范v1.0

    Linux系统部署规范v1.0 目的: 1.尽可能减少线上操作: 2.尽可能实现自动化部署: 3.尽可能减少安装服务和启动的服务: 4.尽可能使用安全协议提供服务: 5.尽可能让业务系统单一: 6.尽 ...

随机推荐

  1. mongodb拆库分表脚本

    脚本功能: 1. 将指定的报告文件按照指定的字段.切库切表策略切分 2. 将切分后的文件并发导入到对应的Mongodb中 3. 生成日志文件和done标识文件 使用手册: -h    打印帮助信息,并 ...

  2. 利用Python分析GP服务运行结果的输出路径 & 实现服务输出路径的本地化 分类: Python ArcGIS for desktop ArcGIS for server 2015-08-06 19:49 3人阅读 评论(0) 收藏

    最近,一直纠结一个问题:做好的GP模型或者脚本在本地运行,一切正常:发布为GP服务以后时而可以运行成功,而更多的是运行失败,甚至不能知晓运行成功后的结果输出在哪里. 铺天盖地的文档告诉我,如下信息: ...

  3. Django框架【基础篇】

    Python的WEB框架有Django.Tornado.Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM.模型绑定.模板引擎.缓存.Session等诸多功能. ...

  4. Flask简介之简单应用

    Flask 0.Flask简介 Flask是一个基于Python开发并且依赖jinja2模板和Werkzeug WSGI服务的一个微型框架,对于Werkzeug本质是Socket服务端,其用于接收ht ...

  5. 简单的共享文件http

    如果你急需一个简单的Web Server,但你又不想去下载并安装那些复杂的HTTP服务程序,比如:Apache,ISS等.那么, Python 可能帮助你.使用Python可以完成一个简单的内建 HT ...

  6. centos Linux下磁盘管理 parted,df ,du,fdisk,partprobe,mkfs.ext4,mount,/etc/fstab,fsck,e2fsck,mk2efs,tmpfs ,nr_inodes, LVM,传统方式扩容文件系统 第七节课

    centos Linux下磁盘管理   parted,df ,du,fdisk,partprobe,mkfs.ext4,mount,/etc/fstab,fsck,e2fsck,mk2efs,tmpf ...

  7. 002-and design-基于dva的基本项目搭建

    一.概述 在真实项目开发中,你可能会需要 Redux 或者 MobX 这样的数据应用框架,Ant Design React 作为一个 UI 库,可以和任何 React 生态圈内的应用框架搭配使用.我们 ...

  8. JS操作符转化数字

    在Node.js源代码里,随处可见使用各种符号处理字符串为数字的.可能由于不同人编写,使用的风格也各有不同. 基本上有下面几种. 将字符串转化为数字 + 将一个数字的字符串转化为数字很简单的一种做法就 ...

  9. ThreadLocal类,实例测试,FutureTask类,实例测试。

    1:测试ThreadLocal类,  为每个线程域保存局部变量.例如下面的例子. ThreadLocal为每个线程保存了一个Test对象,  那么当执行线程时,每个线程中的test具有唯一性.某一个线 ...

  10. python实现http接口自动化测试(完善版)

    今天给大家分享一个简单的Python脚本,使用python进行http接口的自动化测试,脚本很简单,逻辑是:读取excel写好的测试用例,然后根据excel中的用例内容进行调用,判断预期结果中的返回值 ...