主配置文件:

cat /etc/nginx/nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
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 /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

client_header_buffer_size 16k;
large_client_header_buffers 4 64k;
client_max_body_size 5M;

proxy_headers_hash_max_size 2048;
proxy_headers_hash_bucket_size 256;

include /etc/nginx/mime.types;
default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
}

各服务配置文件:

服务一:

cat api.xxx.com.conf
server {
listen 90;
server_name api.xxx.com;

#location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
#}

location / {
root /data/www_xxx/h5html;
index index.html index.htm;
proxy_pass http://127.0.0.1:28080;

# Forward the user's IP address to Rails
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

}

服务二:

cat  m.api.xxx.com.conf
server {
listen 80;
server_name  m.api.xxx.com;

#location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
#}

location / {
root /data/www/h5html;
index index.html index.htm;

# Forward the user's IP address to Rails
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;

if ( !-e $request_filename ) {
proxy_pass http://127.0.0.1:28080;
}
}

location ~ .*\.(html|htm) {
root /data/fulu/www_fulucz/h5html;
#expires 30d; #缓存30天
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

}

server {
listen 90;
server_name m.api.xxx.com;

return 301 https://m.api.xxx.com$request_uri;
}

nginx 配置信息的更多相关文章

  1. flask uwsgi和nginx配置信息

    1. 安装 pip3 install uwsgi 2. uwsgi配置信息 创建一个uwsgi.ini文件 [uwsgi] socket=/opt/script/uwsgi.sock #启动程序时所使 ...

  2. Nginx配置信息损毁又无备份时如何恢复

    worker_processes *; 本文介绍在Nginx配置信息出现问题后,在没有备份的情况下,如何利用Nginx进程的虚拟内存恢复配置信息. 问题背景 假设 /etc/nginx/site-av ...

  3. [转]Nginx配置信息详解

    序言 Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的.从2004年发布至今,凭借开源的力量,已经接近成熟与完善. Nginx功能丰富,可作为HTTP服务器,也 ...

  4. 自己站点的nginx 配置信息

    user www www; worker_processes auto; error_log /home/wwwlogs/nginx_error.log crit; pid /usr/local/ng ...

  5. nginx配置ssl证书实现https访问

    一,环境说明 服务器系统:ubuntu16.04LTS 服务器IP地址:47.89.12.99 域名:bjubi.com 二,域名解析到服务器 在阿里云控制台-产品与服务-云解析DNS-找到需要解析的 ...

  6. 阿里云 nginx配置ssl证书实现https访问

    一,环境说明 服务器系统:ubuntu16.04LTS 服务器IP地址:47.89.12.99 域名:bjubi.com 二,域名解析到服务器 在阿里云控制台-产品与服务-云解析DNS-找到需要解析的 ...

  7. nginx配置ssl证书实现https

    一,环境说明 服务器系统:centos6 服务器IP地址:0.0.0.0 域名:bjubi.com 二,域名解析到服务器 在阿里云控制台-产品与服务-云解析DNS-找到需要解析的域名点“解析”,进入解 ...

  8. [转帖]nginx配置ssl证书实现https访问

    https://www.cnblogs.com/tianhei/p/7726505.html 今天就是如此处理的 感觉挺不错的. 一,环境说明 服务器系统:ubuntu16.04LTS 服务器IP地址 ...

  9. nginx入门与实战 安装 启动 配置nginx Nginx状态信息(status)配置 正向代理 反向代理 nginx语法之location详解

    nginx入门与实战 网站服务 想必我们大多数人都是通过访问网站而开始接触互联网的吧.我们平时访问的网站服务 就是 Web 网络服务,一般是指允许用户通过浏览器访问到互联网中各种资源的服务. Web ...

随机推荐

  1. 手动更新nexus的索引

    安装nexus 1.下载 源码包 nexus-2.13.0-01-bundle.tar.gz 下载地址 http://www.sonatype.org/nexus/ 2.解压源码包 3.启动并访问 . ...

  2. tomcat出现Error in dependencyCheck java.io.IOException: invalid manifest format

    我只能说这个错误很坑爹,检查了很多地方都没问题,结果最后在MANIFEST.MF 里面把所有的空的行都删掉就好了.坑爹有木有.

  3. VirtualBox 扩展包卸载或安装失败(VERR_ALREADY_EXISTS)(转)

    文章出处:http://blog.csdn.net/leshami/article/details/9232229 最近在卸载VirtualBox出现了无法卸载的错误.提示为Failed to ins ...

  4. Qt.网络开发-通过http的get方式获取数据

    Qt 是一个跨平台的 C++图形用户界面库,由挪威 TrollTech 公司于1995年底出品. 它是个跨平台的C++图形开发平台 我们在这章中可以学习简单的网络数据获取并显示的内容 本文基于Qt C ...

  5. JSON Web Token(JWT)机制

    JSON Web Token(JWT)机制  JWT是一种紧凑且自包含的,用于在多方传递JSON对象的技术.传递的数据可以使用数字签名增加其安全行.可以使用HMAC加密算法或RSA公钥/私钥加密方式. ...

  6. 应用通信-方案二:Feign

    ------------------客户端controller层--------------------- @RestController public class ClientFeignContro ...

  7. VS2008中捕获内存泄露(转)

    内存泄露十分讨厌,捕获内存泄露更加令人厌烦…… 其实,VS本身就有内存泄露的检测机制.只需做以下操作即可开启.(同时必须在debug模式 下运行程序并且以 正常流程退出 ) // 在入口函数cpp中添 ...

  8. GOCN每日新闻(2017-08-12)

    1.为什么我们从 Python 转向 Go 2.Go 实现常见数据结构 3.3年半,50万行 Go 代码 4.Go 游戏引擎 oka 5.Go 是隐藏学习曲线的语言

  9. [Java web]Spring+Struts2+Hibernate整合过程(2)

    摘要 上篇文章介绍了一种整合方式,不妨就叫做有hibernate配置文件的方式,这里介绍一种不用hibernate.cfg.xml的一种配置方式,为了方便,就仍在上篇的demo中,继续修改了. 步骤 ...

  10. Detour3.0 win7 64bit下的安装

    最近在做API hook相关的东西,用了inline hook后感觉不错,但是查找资料发现inline hook并不稳定 inline hook 的原理是在系统访问一个函数的时候先替换原函数入口处的内 ...