开发者社区> 问答> 正文

[@talishboy][¥20]nginx tomcat请求分发

配置好,启动后tomcat请求能够分发到不同端口的登录界面,但是填好账号和密码后,点击提交就请求不到了!

nginx.cof/劳烦大家给点帮助....thx

user nobody;

worker_processes 2;

error_log logs/error.log;

error_log logs/error.log notice;

error_log logs/error.log info;

pid logs/nginx.pid;

events {

use epoll;
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    0;
keepalive_timeout    65;

gzip    on;

upstream tomcat_server {
    server 192.168.0.185:8091 weight=5;
    server 192.168.0.185:8092 weight=5;
    server 192.168.0.185:8093 weight=5;
}

server {
    listen       81;
    server_name  localhost;

    charset utf-8;

    access_log  logs/host.access.log  main;

    location / {
        proxy_pass http://tomcat_server;
        proxy_redirect    off;
        proxy_set_header    Host $host;
               proxy_set_header    X-Real-IP $remote_addr;
               proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
               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;

展开
收起
晓生寒 2018-12-14 16:07:15 2767 0
2 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载