Windows下Nginx+Tomcat整合的安装与配置
2016-01-06 00:00
609 查看
摘要: Windows下Nginx+Tomcat整合的安装与配置
#user nobody;
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;
}
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 main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 3;
gzip_types text/plain application/x-javascript application/javascript text/css application/xml;
gzip_vary on;
upstream test.pinganziben.com {
server localhost:8080;
}
## 这里取得原始用户的IP地址
map $http_x_forwarded_for $clientRealIp {
"" $remote_addr;
~^(?P<firstAddr>[0-9\.]+),?.*$ $firstAddr;
}
## 针对原始用户 IP 地址做限制
#limit_conn_zone $clientRealIp zone=TotalConnLimitZone:20m ;
#limit_conn TotalConnLimitZone 50;
#limit_conn_log_level notice;
## 针对原始用户 IP 地址做限制
#limit_req_zone $clientRealIp zone=ConnLimitZone:20m rate=10r/s;
#limit_req zone=ConnLimitZone burst=10 nodelay;
#limit_req_log_level notice;
#tomcat代理
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:8080; }
}
#设定访问静态文件直接读取不经过
server {
listen 3333;
server_name localhost;
#limit_req zone=ConnLimitZone burst=1 nodelay;
root C:/antiques;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|html)$ #
{
expires 1d;
&nbs
3ff0
p; }
}
}
#user nobody;
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;
}
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 main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 3;
gzip_types text/plain application/x-javascript application/javascript text/css application/xml;
gzip_vary on;
upstream test.pinganziben.com {
server localhost:8080;
}
## 这里取得原始用户的IP地址
map $http_x_forwarded_for $clientRealIp {
"" $remote_addr;
~^(?P<firstAddr>[0-9\.]+),?.*$ $firstAddr;
}
## 针对原始用户 IP 地址做限制
#limit_conn_zone $clientRealIp zone=TotalConnLimitZone:20m ;
#limit_conn TotalConnLimitZone 50;
#limit_conn_log_level notice;
## 针对原始用户 IP 地址做限制
#limit_req_zone $clientRealIp zone=ConnLimitZone:20m rate=10r/s;
#limit_req zone=ConnLimitZone burst=10 nodelay;
#limit_req_log_level notice;
#tomcat代理
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:8080; }
}
#设定访问静态文件直接读取不经过
server {
listen 3333;
server_name localhost;
#limit_req zone=ConnLimitZone burst=1 nodelay;
root C:/antiques;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|html)$ #
{
expires 1d;
&nbs
3ff0
p; }
}
}
相关文章推荐
- Tomcat 简单配置(JAVA8 VM Args)
- 让手机访问电脑的tomcat
- tomcat双向认证
- Tomcat 设置系统登录用户
- tomcat相关问题
- java项目部署总结(二)tomcat安装与配置Native APR 模式
- 通过windows把项目部署到Linux的tomcat中
- Tomcat优化参数
- 修改Tomcat 6 默认的ROOT
- 在tomcat中指定jdk,不配置环境变量
- Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules
- 网站缓存数据到tomcat服务器
- Tomcat Server.xml详解
- 同一个tomcat下配置多个域名
- 关于 tomcat 集群中 session 共享的三种方法
- tomcat使用APR后性能竟然毫无提升
- Tomcat服务器下部署项目几种方式
- tomcat一闪而过
- apache和tomcat区别(转)
- hibernate 在tomcat7.X 下配置mysql数据源