user apache; worker_processes 1; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } # load modules compiled as Dynamic Shared Object (DSO) # #dso { # load ngx_http_fastcgi_module.so; # load ngx_http_rewrite_module.so; #} 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 0; keepalive_timeout 65; gzip on; upstream app.某个域名.com { #tomcat的监听端口,这边做分发 server localhost:18443; server localhost:28443; } server { listen 443 ssl; server_name localhost; charset utf-8; access_log logs/host.access.log; ssl_certificate /usr/local/nginx/cert/1_app.某个域名.com_bundle.crt; ssl_certificate_key /usr/local/nginx/cert/2_app.某个域名.com.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; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # # error_page 400 401 403 404 /40x.html; location = /40x.html { root html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # location ~ \.htm$ { proxy_pass https://app.某个域名.com; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|css|zip|js)$ { proxy_pass https://app.某个域名.com; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # 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 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 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; # } #} }
注意:Tomcat 之类的应用服务器也需要配置https证书
相关推荐
3、Nginx+Tomcat负载均衡配置 首先创建两个文件,这两个文件 我来提供,将这两个文件拷入Nginx的conf文件夹下 1.proxy.conf 文件内容 #负责代理转发 proxy_redirect off; proxy_set_header Host $host; proxy_set_...
Nginx+tomcat配置集群负载均衡实现动静分离实例
nginx+tomcat负载均衡简单配置
Nginx++Keepalived+Tomcat负载 均衡 &动 静 分 离。配置
keepalived+Nginx+Tomcat负载均衡配置文档,生产实施原文档,欢迎大家参考。
包含课件和源代码适合与开发人员和运维人员学习和深入理解
文档非常详细介绍了linux下nginx+tomcat负载均衡配置 包括nginx安装 nginx配置 tomcat配置 验证配置与测试负载均衡 nginx与tomcat动静态请求分离配置 nginx缓存配置。
小型网站上进行的nginx+tomcat负载均衡与动静分离
手把手教你搭建Nginx+Tomcat 集群的搭建,多个节点,实现负载均衡最全教程,图文教程
Nginx+tomcat 实现负载均衡session共享demo,和http://blog.csdn.net/u014513883/article/details/48550709 类似
部署Nginx+Tomcat负载均衡集群部署思路: 1、Tomcat服务器设置 关闭防火墙 //两台保持一致 安装JDK //两台保持一致 安装Tomcat //两台保持一致 创建站点/www/test目录,修改server.xml文件 //两台保持一致 创建...
win7环境下nginx+tomcat均衡负载配置,减轻服务器的负担,提高服务器性能
redis+tomcat+nginx负载均衡配置 非常详细,下载放入项目即可使用
Tomcat+nginx+redis负载均衡配置,Linux下配置NGINX和Redis实现负载均衡和资源共享
Linux下Nginx+Memcached+Tomcat负载均衡集群服务搭建所需jar包
Nginx+Tomcat配置3台负载均衡及https
nginx+tomcat 负载、集群简单搭建,适合新手。
资源包含 nginx+tomcat+redis负载均衡及session共享,所需的jar包,redis桌面程序,以及相关的配置说明文档
最新Nginx1.9.4+Tomcat+Memcached负载均衡配置,里面写的很详细,用到的所有文件也都在里面的