主配置文件:

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. mybatis批量插入数据

    Mybatis在执行批量插入时,如果使用的是for循环逐一插入,那么可以正确返回主键id.如果使用动态sql的foreach循环,那么返回的主键id列表,可能为null,这让很多人感到困惑:本文将分析 ...

  2. Centos7 MongoDB-3.4

    MongoDB 是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的 关系型数据库遵循ACID规则 事务在英文中是transaction,和现实世界中的交易很类 ...

  3. CocosCreator内置函数实现物体拖动

    通过CocosCreator由内置的cc.Node.EventType.MOUSE_MOVE鼠标(触摸)事件实现,返回参数为鼠标的坐标值. 根据鼠标的x,y实现物体的移动,即将鼠标放置在该节点上,实现 ...

  4. ASP.NET MVC 4 中的JSON数据交互

    前台Ajax请求很多时候需要从后台获取JSON格式数据,一般有以下方式: 拼接字符串 return Content("{\"id\":\"1\",\& ...

  5. __Linux__操作系统发展史

    常见操作系统win7.Mac.Android.iOS . 操作系统的发展史 1.Unix 1965年之前的时候,电脑并不像现在一样普遍,它可不是一般人能碰的起的,除非是军事或者学院的研究机构,而且当时 ...

  6. delphi Tdxribbon 设置背景和skin 皮肤

    https://blog.csdn.net/maxwoods/article/details/8592389 http://www.cnblogs.com/baoluo/archive/2011/04 ...

  7. iOS:使用莱文斯坦距离算法计算两串字符串的相似度

    Levenshtein:莱文斯坦距离 Levenshtein的经典算法,参考http://en.wikipedia.org/wiki/Levenshtein_distance的伪代码实现的,同时参考了 ...

  8. 五花八门的Shell 的相关概念和配置方法

    使用Linux的过程中少不了使用各种各样的Shell, 而根据启动环境的不同,Shell会读取不同的配置文件. 本文便来详细介绍这些不同名字的配置文件在何时会被Shell读取. 什么是 Shell S ...

  9. 【T03】理解私有地址和NAT

    1.私有地址包括三块: 10.0.0.0 到 10.255.255.255 172.16.0.0 到 172.31.0.0 192.168.0.0 到 192.168.255.255 2.私有地址接入 ...

  10. SublimeText SFTP连接Amazon EC2

    文章最初发表于szhshp的第三边境研究所 转载请注明 1. SublimeText SFTP连接Amazon EC2 Sublime Text 3 正式版发布了,全平台IDE果断都换了. 今天终于有 ...