#user  nobody;
worker_processes ; pid /var/run/nginx.pid; events {
worker_connections ;
} http {
include mime.types; # 加载naxsi
include naxsi_core.rules; default_type text/html; 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 main; sendfile on; keepalive_timeout ; gzip on; upstream baseserver
{
server 127.0.0.1:;
} upstream ssoserver
{
server 127.0.0.1:;
} server {
listen ;
listen ;
#listen ssl http2;
server_name localhost;
# 黄海添加于2018--
#ssl on;
#ssl_certificate /usr/local/openresty/nginx/conf/cacert.pem;
#ssl_certificate_key /usr/local/openresty/nginx/conf/rsa_private_key.pem;
#ssl_session_timeout 5m;
#让http请求重定向到https请求
#error_page https://$host$uri?$args; location =/ {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://baseserver/baseService/;
proxy_redirect http://$host/ http://$http_host/;
} location /baseService/html/ {
root /usr/local/tomcat8/webapps;
expires 30d;
} location /dsssoserver/html/ {
root /usr/local/tomcat8/webapps;
expires 30d;
} location ^~ /baseService {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://baseserver;
} location ^~ /dsssoserver {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://ssoserver;
} # 配置403
location /errPage {
#root /usr/local/openresty/nginx/html;
rewrite ^/(.*)$ https://$host/403/403.html permanent;
} location ^~// {
root /usr/local/openresty/nginx/html;
} # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} }
}

Nginx中配置undertow进行两个项目的动静分离配置的更多相关文章

  1. nginx 的动静分离配置(tomcat)

    nginx+tomcat是想动静分离配置 首先在nginx的配置文件中添加tomcat的的集群配置 upstream tomcats { ip_hash; server 192.168.0.251:8 ...

  2. 001/Nginx高可用模式下的负载均衡与动静分离(笔记)

    Nginx高可用模式下的负载均衡与动静分离 Nginx(engine x)是一个高性能的HTTP和反向代理服务器,具有内存少,并发能力强特点. 1.处理静态文件.索引文件以及自动索引:打开文件描述符缓 ...

  3. Linux下Nginx+Tomcat负载均衡和动静分离配置要点

    本文使用的Linux发行版:CentOS6.7 下载地址:https://wiki.centos.org/Download 一.安装Nginx 下载源:wget http://nginx.org/pa ...

  4. nginx+tomcat网页动静分离配置

    1.环境描述 nginx server (Proxy):192.168.1.135(作为代理服务器)WEB server1: 192.168.1.138(使用tomcat作为web容器)WEB ser ...

  5. nginx动静分离配置

    动静分离: 所谓动静分离指的是当访问静态资源时,路由到一台静态资源服务器,当访问是非静态资源时,路由到另外一台服务器 静态资源配置: 如配置如下location 表示url为  /static/*.x ...

  6. Nginx加多个tomcat实现负载均衡,动静分离

    一:Nginx+Tomcat的动静分离 所谓动静分离就是通过nginx(或apache等)来处理用户端请求的图片.html等静态的文件,tomcat(或weblogic)处理jsp.do等动态文件,从 ...

  7. Haproxy 基础详解及动静分离配置

    haproxy 介绍 1 工作在ISO 七层 根据http协议(或者工作在ISO四层 根据tcp协议) 提供web服务的负载均衡调度器 负载均衡调度器分类 工作在四层: # lvs 工作在七层: # ...

  8. Varnish动静分离配置示例

    动静分离 [root@varnish ~]# vim /etc/varnish/default.vclvcl 4.0;backend web { .host = "192.168.30.15 ...

  9. centos nginx 中安装ssl证书 以及在项目中的使用

    今天阿里云的证书到期了,重新申请了一个,下面是从申请到安装以及结合项目使用的过程: 1.登录阿里云   2.在左侧找到SSL证书 3.申请免费的证书 4.下载证书 5.根据说明配置nginx 6.在项 ...

随机推荐

  1. 关于树的常见操作-C++面试

    #include <iostream> using namespace std; //树的存储结构与设计 struct BitNode { int data; BitNode* leftC ...

  2. 【VMware vSphere】ESXi系统开启SSH协议

    写在前面:           SSH为建立在应用层基础上的安全协议,是目前较为可靠,专为远程登录会话和其他网络服务提供安全性的协议.感兴趣的话,可以百度了解           在这里,我们需要将S ...

  3. tar命令加密压缩

    场景 Centos6下使用加密压缩,可以从A机器到B机器解压. 可用在kali上解压就不行. 命令 解包 tar zxvf FileName.tar 打包 tar czvf FileName.tar ...

  4. installshield路径

    InstallShield系统变量 BATCH_INSTALL 指示当传输文件采用LOCKEDFILE或SHAREDFILE时是否锁定文件 CMDLINE Setup.exe传递的命令行参数 COMM ...

  5. 在Ubuntu 16.04下安装nodejs

    源安装: 1.curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - 2.sudo apt-get install -y node ...

  6. 最新版Kali Linux虚拟机安装Open-vm-tools替代VMware tools

    自从Kali 2.0发布之后,会经常遇到安装vmware tools无法成功,或者提示安装成功了但是仍旧无法进行文件拖拽.复制和剪切的问题. 今天给新电脑装系统,重新下载了最新版,Kali 2017. ...

  7. boost.Asio lib

    Documentation for Boost.Asio http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio.html https://w ...

  8. python学习第9-10天,函数。

    函数初识 为什么要使用函数? 函数最重要的目的是方便我们重复使用相同的一段程序. 将一些操作隶属于一个函数,以后你想实现相同的操作的时候,只用调用函数名就可以,而不需要重复敲所有的语句. 函数的定义与 ...

  9. VUE 图片验证码

    1. 概述 1.1 说明 在开发过程中,有时候需要使用图片验证码进行增加安全强度,在点击图片时更新新的图片验证码,记录此功能,以便后期使用. 2. 示例 2.1 vue示例代码 <templat ...

  10. chrome调试工具怎么限制网速

    在做项目的时候,我们测试的时候有时需要限制网速