前端nginx配置
对nginx还是处于小白阶段,知道的只是简单基础,以下配置没有问题,已实现
文件:nginx-1.15.11\conf\nginx.conf
注释:#
后台接口 :location ^~ /gestep-web/
location ^~ /gestep-image/
...
本地代码 :location /playground
location /app
#user nobody;
worker_processes ; error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; #gzip on; server {
listen ;
server_name localhost; # substitute your machine's IP address or FQDN
charset utf-;
client_max_body_size 75M; # adjust to taste location ^~ /gestep-web/ {
proxy_pass http://192.168.2.41:8080/gestep-web/;
# proxy_pass http://localhost:8083/gestep-web/;
}
location ^~ /gestep-image/ {
proxy_pass http://117.107.179.196/api/yoonuu/;
#proxy_pass http://192.168.2.88/api/yoonuu/;
} location ^~ /gestep-app/ {
proxy_pass http://localhost:8082/gestep-app/;
} location /playground {
alias E:/codes/HBuilder/web_ge-pt/;
#alias E:/codes/HBuilder/web-playground_fork/;
#alias E:/codes/HBuilder/web-playground_feature_pm/;
}
location /app {
alias E:/codes/HBuilder/web-app/;
}
} server {
listen ;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
} #error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen ;
# listen somename:;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
HBuilderX.exe配置
打开运行配置

此时的编辑器配置和nginx配置都有playground 名称,配置好nginx后还需重启
前端nginx配置的更多相关文章
- nginx配置前端代理
#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log notice;#error_l ...
- 前端部署: nginx配置
前提:nginx 已安装 简介:nginx(engine x) 是一个高性能的HTTP和反向代理服务,也是一个IMAP/POP3/SMTP服务.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Ram ...
- Nginx 前端项目配置 包含二级目录和接口代理
Nginx是目前用的比较多的一个前端服务器 其优点是配置简单修改一下server就能用 并发性能比较好,具体怎么好就看这个吧 开撸 1.找到nginx (liunx系统,已安装) whereis ng ...
- 前端搭建Linux云服务器,Nginx配置详解及部署自己项目到服务器上
目录 搭建Linux云服务器 购买与基本配置 链接linux服务器 目录结构 基本命令 软件安装 Linux 系统启动 启动过程 运行级别 Nginx详解 1.安装 方式一:yum安装 方式二:自定义 ...
- nginx配置一、二级域名、多域名对应(api接口、前端网站、后台管理网站)
前提:安装好nginx,如果已经启动nginx,先停止,命令: ./usr/local/nginx/sbin/nginx -s stop 修改nginx配置 vi /usr/local/nginx/c ...
- nginx配置反向代理或跳转出现400问题处理记录
午休完上班后,同事说测试站点访问接口出现400 Bad Request Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...
- Windos环境用Nginx配置反向代理和负载均衡
Windos环境用Nginx配置反向代理和负载均衡 引言:在前后端分离架构下,难免会遇到跨域问题.目前的解决方案大致有JSONP,反向代理,CORS这三种方式.JSONP兼容性良好,最大的缺点是只支持 ...
- Nginx 配置简述
不论是本地开发,还是远程到 Server 开发,还是给提供 demo 给人看效果,我们时常需要对 Nginx 做配置,Nginx 的配置项相当多,如果考虑性能配置起来会比较麻烦.不过,我们往往只是需要 ...
- Liunx下Tomcat+MYSQL+Nginx配置
环境:centos6.4 min #安装编译库及依赖模块 yum -y install gcc gcc-c++ autoconf automake make yum -y install zlib z ...
随机推荐
- bash: sz: command not found
Linux系统中如果没有安装 lrzsz这个包,就会报rz.sz命令找不到,安装即可解决. 命令: yum install lrzsz 效果图:
- YARN构建--解决cypress下载慢问题
背景 注意: 此方案仅适合已经自行搭建私有仓库的用户使用 如非必要,尽可能使用软件开发云或其他服务提供的镜像站,避免此类特殊处理(会导致仓库维护成本增加) 场景描述 YARN构 ...
- vue 组件的通信方式(完整版)
几种通信方式无外乎以下几种: Prop(常用) $emit (组件封装用的较多) .sync语法糖 (较少) $attrs & $listeners (组件封装用的较多) provide &a ...
- Comet OJ - Contest #7
传送门 \(A\) 咕咕咕 int main(){ for(scanf("%d",&T);T;--T){ scanf("%d%d",&l,&am ...
- VM 虚拟机 CentOS 7 设置 桥接网络
桥接网络的设置: 安装时设置网络为桥接网络! 找到 ip 地址,设置如下 注意ip地址并不是一样的,用以区分 然后在关闭 windows 防火墙,打开 cmd 使用 ping 命令 O ...
- python threading多线程
import threading import time def print_time(threadName, delay, iterations): start = int(time.time()) ...
- centos7 安装 Mysql 5.7.27,详细完整教程
1. 下载 MySQL yum包 wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm 2.安装MySQL源 ...
- Mysql之数据库设计规范
1. 三大范式首先要明白”范式(NF)”是什么意思.按照教材中的定义,范式是“符合某一种级别的关系模式的集合,表示一个关系内部各属性之间的联系的合理化程度”.数据库范式也分为1NF,2NF,3NF,B ...
- qt 关于Qt中MVC的介绍与使用
Qt包含一组使用模型/视图结构的类,可以用来管理数据并呈现给用户.这种体系结构引入的分离使开发人员更灵活地定制项目,并且提供了一个标准模型的接口,以允许广泛范围的数据源被使用到到现有的视图中. 模型 ...
- 制作A4纸打印的网页像素大小设置(转)
公司内做系统,要用A4纸打印东西,A4纸标准时mm,换算成像素不知道.网上找找,找到一篇文章,转一下,备用. A4纸的尺寸是210mm*297mm,也就是21.0cm*29.7cm,而1英寸=2.54 ...