Nginx Tomcat

来源:互联网 发布:js 获取iframe 对象 编辑:程序博客网 时间:2024/05/20 16:42
不怪你们,我真的不记得,我不会。真心话,我不明白很多事有记忆的必要性。
其实和redis什么都一样,学一个新的软件,安装使用过程而已。请求先到达nginx,然后它分配给tomcat。古人学问无遗力,少壮工夫老始成。纸上得来终觉浅,绝知此事要躬行。下载地址:http://nginx.org/en/download.htmlnginx: downloadMainline versionCHANGESnginx-1.13.4  pgpnginx/Windows-1.13.4  pgpStable versionCHANGES-1.12nginx-1.12.1  pgpnginx/Windows-1.12.1  pgpLegacy versionsCHANGES-1.10nginx-1.10.3  pgpnginx/Windows-1.10.3  pgpCHANGES-1.8nginx-1.8.1  pgpnginx/Windows-1.8.1  pgpCHANGES-1.6nginx-1.6.3  pgpnginx/Windows-1.6.3  pgpCHANGES-1.4nginx-1.4.7  pgpnginx/Windows-1.4.7  pgpCHANGES-1.2nginx-1.2.9  pgpnginx/Windows-1.2.9  pgpCHANGES-1.0nginx-1.0.15  pgpnginx/Windows-1.0.15  pgpCHANGES-0.8nginx-0.8.55  pgpnginx/Windows-0.8.55  pgpCHANGES-0.7nginx-0.7.69  pgpnginx/Windows-0.7.69  pgpCHANGES-0.6nginx-0.6.39  pgpCHANGES-0.5nginx-0.5.38  pgp参考博客:http://blog.csdn.net/kooalle_cln/article/details/49591493http://blog.csdn.net/wang379275614/article/details/47778201Nginx+resin参考博客:http://os.51cto.com/art/201111/304609.htm



nginx.conf

#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  0;    keepalive_timeout  65;    #gzip  on;        upstream key_zengwenfeng    {    server 127.0.0.1:4040;    server 127.0.0.1:5050;    }        server {        listen       80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            proxy_pass http://key_zengwenfeng;        }        #error_page  404              /404.html;        # redirect server error pages to the static page /50x.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 ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # 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;    #    }    #}}