`

nginx.conf

阅读更多
user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    # multi_accept on;
}

http {
    include       /etc/nginx/mime.types;

    access_log /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";


proxy_redirect          off;
proxy_set_header        Host $host;
proxy_set_header        X-Real-IP $remote_addr; #获取真实IP
#proxy_set_header       X-Forwarded-For   $proxy_add_x_forwarded_for; #获取代理者的真实ip
client_max_body_size    10m;
client_body_buffer_size 128k;
proxy_connect_timeout   90;
proxy_send_timeout      90;
proxy_read_timeout      90;
proxy_buffer_size       4k;
proxy_buffers           4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

include /etc/nginx/sites-enabled/*;

    server {
        listen       8090;
        server_name  localhost;
        charset utf-8;
        location / {
             root /var/www/nginx-default;
        }
location ~ .*.jsp$ #所有jsp的页面均交由tomcat处理
{
index index.jsp;
proxy_pass http://localhost:8080;#转向tomcat处理
}

location ~ .*.do$ #所有do的页面均交由tomcat处理
{
index index.do;
proxy_pass http://localhost:8080;#转向tomcat处理
}

location ~ .*.json$ #所有do的页面均交由tomcat处理
{
index index.do;
proxy_pass http://localhost:8080;#转向tomcat处理
}


      
    }

}

http://wiki.ubuntu.org.cn/UbuntuSkills
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics