server_names_hash_bucket_size 512;
upstream node_app {
server 127.0.0.1:3000;
}

server {
listen 80;
server_name www.abc.net;

location / {
proxy_pass http://node_app;
}
}

server {
listen 80;
server_name www.abc.net;

location / {
#proxy_pass http://node_app;
proxy_pass http://www.abc.com;
proxy_set_header X-Forwarded-Host $host;
}
}

server {
listen 80;
server_name g.abc.me;

location / {
#proxy_pass http://node_app;
proxy_pass http://www.abc.com;
proxy_set_header X-Forwarded-Host $host;
}
}

--stop nginx on windows--

nginx -s stop

--start nginx with config file
nginx -c ~/mynginx.conf
--testing nginx with config file, but not run
nginx -t -c ~/mynginx.conf
nginx -s reload

nginx demo的更多相关文章

  1. Docker 使用入门,创建一个Nginx服务器

    运行环境: MAC Docker 版本: Docker version 17.12.0-ce, build c97c6d6 一.启动Nginx 服务器 启动Nginx 服务器,并进入模拟终端 dock ...

  2. 腾讯云手动搭建nginx+php-fpm并自启动

    自己一点小爱好,搭建了一个小网站植物大战僵尸百科, 使用的是腾讯云,市场里的镜像不好用,所以自己手动搭建一波. centos 7 编译安装 php-7.2.11的步骤 在官网下载php-7.2.11的 ...

  3. Docker NGINX 例子

    版权所有,未经许可,禁止转载 章节 Docker 介绍 Docker 和虚拟机的区别 Docker 安装 Docker Hub Docker 镜像(image) Docker 容器(container ...

  4. NGINX configure auto generator

    NGINX configure auto generator The easiest way to configure a performant, secure, and stable NGINX s ...

  5. Docker 1.12 集群

        环境介绍 虚拟机两台,vmware ,网络为NAT node139:192.168.190.139 Node140: 192.168.190.140     设置hostname 以139为例 ...

  6. 团队一致性的PHP开发环境之Docker

    docker php环境模型 docker 简介 Docker 是一个开源的应用容器引擎 让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现 ...

  7. 初识nginx之第一个demo

    商城项目做了一个多月了,想到必须用到负载均衡,简单了解了一下nginx,首先分享第一个demo,五月份上线后,会继续分享一系列相关知识. 在nginx根目录下,用了一个园友的批处理文件nginx.ba ...

  8. Nginx + FastCGI 程序(C/C++) 搭建高性能web service的Demo及部署发布

       FastCGI编程包括四部分:初始化编码.接收请求循环.响应内容.响应结束循环. FCGX_Request request; FCGX_Init(); ); FCGX_InitRequest(& ...

  9. 【入门篇】Nginx + FastCGI 程序(C/C++) 搭建高性能web service的Demo及部署发布

    http://blog.csdn.net/allenlinrui/article/details/19419721 1.介绍     Nginx - 高性能web server,这个不用多说了,大家都 ...

随机推荐

  1. hdu 4411 最小费用流

    思路:主要就是要把一个每个城市拆为两个点,建一条容量为1,费用为-inf的边,保证每个城市都会被遍历. /*最小费用最大流*/ #include<iostream> #include< ...

  2. 统计机器学习(statistical machine learning)

    组要组成部分:监督学习(supervised learning),非监督学习(unsupervised learning),半监督学习(semi-supervised learning),强化学习(r ...

  3. HDU 4422 The Little Girl who Picks Mushrooms ( 模拟)

    Problem Description It's yet another festival season in Gensokyo. Little girl Alice planned to pick ...

  4. 关于java中普通代码块、构造代码块与静态代码块

    1.普通代码块 public static void main(String[] args) { /*普通代码块: *直接定义在在方法或语句中出现”{普通代码的执行语句}“的就称为普通代码块. *普通 ...

  5. 无限极分类sql数据库的设计

    --创建测试数据表tb ) , pid ) , name )) ' , null , '广东省') ' , '广州市') ' , '深圳市') ' , '天河区') ' , '罗湖区') ' , '福 ...

  6. 北大ACM(POJ1013-Counterfeit Dollar)

    Question:http://poj.org/problem?id=1013 问题点:排除+验证. Memory: 244K Time: 16MS Language: C++ Result: Acc ...

  7. 总结一下block的几种常用方法

    一.block的简单介绍 block相当于一个参数,有参数的名,有参数的值,有参数的使用,当使用block的时候,它又相当于一个函数,会回调函数体. 声明:void (^block)(void); 实 ...

  8. AMQ学习笔记 - 13. Spring-jms的配置

    概述 如何使用spring-jms来简化jms客户端的开发? 这篇文章主要记录如何配置以便以后复用,而非原理的讲解,有些内容我 没有掌握原理. producer端 producer端负责发送,这里使用 ...

  9. Tomcat提示Null component

    Tomcat提示“严重: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/,J2EEApplication ...

  10. NodeJs多进程和socket.io通讯-DEMO

    一.开启多进程 const os = require('os'); const cp = require('child_process'); const forkList = {}; const fo ...