对nginx还是处于小白阶段,知道的只是简单基础,以下配置没有问题,已实现

文件:nginx-1.15.11\conf\nginx.conf

注释:#

后台接口 :location ^~ /gestep-web/

     location ^~ /gestep-image/

     ...

本地代码 :location /playground

     location /app

  1. #user nobody;
  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;
  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 localhost; # substitute your machine's IP address or FQDN
  35. charset utf-;
  36. client_max_body_size 75M; # adjust to taste
  37.  
  38. location ^~ /gestep-web/ {
  39. proxy_pass http://192.168.2.41:8080/gestep-web/;
  40. # proxy_pass http://localhost:8083/gestep-web/;
  41. }
  42. location ^~ /gestep-image/ {
  43. proxy_pass http://117.107.179.196/api/yoonuu/;
  44. #proxy_pass http://192.168.2.88/api/yoonuu/;
  45. }
  46.  
  47. location ^~ /gestep-app/ {
  48. proxy_pass http://localhost:8082/gestep-app/;
  49. }
  50.  
  51. location /playground {
  52. alias E:/codes/HBuilder/web_ge-pt/;
  53. #alias E:/codes/HBuilder/web-playground_fork/;
  54. #alias E:/codes/HBuilder/web-playground_feature_pm/;
  55. }
  56. location /app {
  57. alias E:/codes/HBuilder/web-app/;
  58. }
  59. }
  60.  
  61. server {
  62. listen ;
  63. server_name localhost;
  64.  
  65. #charset koi8-r;
  66.  
  67. #access_log logs/host.access.log main;
  68.  
  69. location / {
  70. root html;
  71. index index.html index.htm;
  72. }
  73.  
  74. #error_page /.html;
  75.  
  76. # redirect server error pages to the static page /50x.html
  77. #
  78. error_page /50x.html;
  79. location = /50x.html {
  80. root html;
  81. }
  82.  
  83. # proxy the PHP scripts to Apache listening on 127.0.0.1:
  84. #
  85. #location ~ \.php$ {
  86. # proxy_pass http://127.0.0.1;
  87. #}
  88.  
  89. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
  90. #
  91. #location ~ \.php$ {
  92. # root html;
  93. # fastcgi_pass 127.0.0.1:;
  94. # fastcgi_index index.php;
  95. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  96. # include fastcgi_params;
  97. #}
  98.  
  99. # deny access to .htaccess files, if Apache's document root
  100. # concurs with nginx's one
  101. #
  102. #location ~ /\.ht {
  103. # deny all;
  104. #}
  105. }
  106.  
  107. # another virtual host using mix of IP-, name-, and port-based configuration
  108. #
  109. #server {
  110. # listen ;
  111. # listen somename:;
  112. # server_name somename alias another.alias;
  113.  
  114. # location / {
  115. # root html;
  116. # index index.html index.htm;
  117. # }
  118. #}
  119.  
  120. # HTTPS server
  121. #
  122. #server {
  123. # listen ssl;
  124. # server_name localhost;
  125.  
  126. # ssl_certificate cert.pem;
  127. # ssl_certificate_key cert.key;
  128.  
  129. # ssl_session_cache shared:SSL:1m;
  130. # ssl_session_timeout 5m;
  131.  
  132. # ssl_ciphers HIGH:!aNULL:!MD5;
  133. # ssl_prefer_server_ciphers on;
  134.  
  135. # location / {
  136. # root html;
  137. # index index.html index.htm;
  138. # }
  139. #}
  140.  
  141. }

HBuilderX.exe配置

打开运行配置

此时的编辑器配置和nginx配置都有playground 名称,配置好nginx后还需重启

前端nginx配置的更多相关文章

  1. nginx配置前端代理

    #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log notice;#error_l ...

  2. 前端部署: nginx配置

    前提:nginx 已安装 简介:nginx(engine x) 是一个高性能的HTTP和反向代理服务,也是一个IMAP/POP3/SMTP服务.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Ram ...

  3. Nginx 前端项目配置 包含二级目录和接口代理

    Nginx是目前用的比较多的一个前端服务器 其优点是配置简单修改一下server就能用 并发性能比较好,具体怎么好就看这个吧 开撸 1.找到nginx (liunx系统,已安装) whereis ng ...

  4. 前端搭建Linux云服务器,Nginx配置详解及部署自己项目到服务器上

    目录 搭建Linux云服务器 购买与基本配置 链接linux服务器 目录结构 基本命令 软件安装 Linux 系统启动 启动过程 运行级别 Nginx详解 1.安装 方式一:yum安装 方式二:自定义 ...

  5. nginx配置一、二级域名、多域名对应(api接口、前端网站、后台管理网站)

    前提:安装好nginx,如果已经启动nginx,先停止,命令: ./usr/local/nginx/sbin/nginx -s stop 修改nginx配置 vi /usr/local/nginx/c ...

  6. nginx配置反向代理或跳转出现400问题处理记录

    午休完上班后,同事说测试站点访问接口出现400 Bad Request  Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...

  7. Windos环境用Nginx配置反向代理和负载均衡

    Windos环境用Nginx配置反向代理和负载均衡 引言:在前后端分离架构下,难免会遇到跨域问题.目前的解决方案大致有JSONP,反向代理,CORS这三种方式.JSONP兼容性良好,最大的缺点是只支持 ...

  8. Nginx 配置简述

    不论是本地开发,还是远程到 Server 开发,还是给提供 demo 给人看效果,我们时常需要对 Nginx 做配置,Nginx 的配置项相当多,如果考虑性能配置起来会比较麻烦.不过,我们往往只是需要 ...

  9. Liunx下Tomcat+MYSQL+Nginx配置

    环境:centos6.4 min #安装编译库及依赖模块 yum -y install gcc gcc-c++ autoconf automake make yum -y install zlib z ...

随机推荐

  1. sql server if exists用法

    if exists用法     if exists 判断表中的内容是否存在     IF EXISTS(SELECT FROM proprice_sheet WHERE vndcode = @vndc ...

  2. 利用亚马逊AWS搭建个人服务器

    转载博客地址:https://www.jianshu.com/p/a045d4217175

  3. 【LGR-059】洛谷7月月赛题解

    传送门 比赛的时候正在大巴上,笔记本没网又没电(不过就算有我估计也不会打就是了) \(A\) 咕咕 const int N=(1<<10)+5; int a[N][N],n; void s ...

  4. Redis批量删除缓存数据

    背景: 在使用redis中,经常会遇到批量删除缓存的情况,但是对于在客户端中,如果一个一个的删除key,则需要较长时间及相对麻烦,可以使用以下命令,批量删除缓存. 本地批量删除KEY: ./redis ...

  5. hdu4283

    You Are the One Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  6. java四种对象引用类型

    java四种对象引用类型 对象的强.软.弱和虚引用 在JDK 1.2以前的版本中,若一个对象不被任何变量引用,那么程序就无法再使用这个对象.也就是说,只有对象处于可触及(reachable)状态,程序 ...

  7. 20175234 2018-2019-2 《Java程序设计》第十周学习总结

    目录 20175234 2018-2019-2 <Java程序设计>第十周学习总结 教材学习内容总结 12.1进程与线程 12.2 Java中的线程 12.3 Thread类与线程的创建 ...

  8. spring boot + vue 前后分离实现登录功能(一)

    使用webpack 打包初始化项目 vue init webpack book-vue 进入工程目录 cd hello-vue 安装 vue-router npm install vue-router ...

  9. ArcGIS超级工具1.6升级说明

    ArcGIS超级工具1.6升级说明:多了:7个工具,总82工具,只支持ArcGIS10.2以上的版本 1.6 Excel转点支持Excel的xls和xlsx,自动识别工作表和字段名,生成点 5.6 M ...

  10. Linux 基于WEB开源的系统管理工具webmin

    Webmin是目前功能最强大的基于Web的Unix系统管理工具.管理员通过浏览器访问Webmin的各种管理功能并完成相应的管理动作.目前Webmin支持绝大多数的Unix系统,这些系统除了各种版本的l ...