1. 程式人生 > >window下nginx基本使用

window下nginx基本使用

下載nginx:http://nginx.org/
開啟nginx:雙擊exe 或者 cmd視窗開啟 : start nginx
配置檔案 ./conf/nginx.conf(片段):
upstream tomcat_server{
server 127.0.0.1:6070;
}

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
       proxy_pass http://tomcat_server;
    }

    #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;
    }

參考:https://www.cnblogs.com/jiangwangxiang/p/8481661.html