• nginx 一般网站部署常用参数设置



    #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 {
    worker_connections 1024;
    }


    http {
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
    client_max_body_size 300m;
    fastcgi_buffers 8 128k;
    send_timeout 3600;
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types text/plain application/x-javascript text/css

    application/xml;
    gzip_vary on;
    upstream server_tomcat81{
    server ip:81;
    }
    upstream server_tomcat82{
    server ip:82;
    }
    upstream server_tomcat83{
    server ip:83;
    }
    server {
    large_client_header_buffers 4 160k;
    client_max_body_size 30m;
    client_body_buffer_size 128k;
    proxy_connect_timeout 30000;
    proxy_read_timeout 3000;
    proxy_send_timeout 3000;
    proxy_buffer_size 64k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    listen 80;
    server_name 域名;
    location / {
    proxy_pass http://server_tomcat81;
    index login.jsp;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }

    }
    server {
    large_client_header_buffers 4 160k;
    client_max_body_size 30m;
    client_body_buffer_size 128k;
    proxy_connect_timeout 3000;
    proxy_read_timeout 3000;
    proxy_send_timeout 3000;
    proxy_buffer_size 64k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    listen 80;
    server_name 域名;
    location / {
    proxy_pass http://server_tomcat82;
    index index.html index.htm login.jsp;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }

    }
    server {
    listen 80;
    large_client_header_buffers 4 160k;
    client_max_body_size 30m;
    client_body_buffer_size 128k;
    proxy_connect_timeout 3000;
    proxy_read_timeout 3000;
    proxy_send_timeout 3000;
    proxy_buffer_size 64k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    server_name 域名;
    location / {
    proxy_pass http://server_tomcat83;
    index index.html index.htm login.jsp;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }

    }


    }

  • 相关阅读:
    在Android工程中运行Java程序问题
    sklearn.neighbors.kneighbors_graph的简单属性介绍
    python中的“.T”操作
    numpy中关于*和dot的区别
    一个Window Service引发的感想
    项目管理之初步认识
    由敏捷开发中开发认领自己的工作内容的感想
    SQL Server2008 inner join多种方式的实践
    浅谈业务逻辑和技术哪个更重要
    敏捷人生之初步认识
  • 原文地址:https://www.cnblogs.com/swite/p/6184358.html
Copyright © 2020-2023  润新知