nginx 反向代理 学习记录

来源:互联网 发布:淘宝直播里的东西好吗 编辑:程序博客网 时间:2024/06/05 20:48

nginx 反向代理

Author : Janloong Do_O

tomcat 配置

<Host name="www.aa.com"  appBase="webapps"            unpackWARs="true" autoDeploy="true">        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"               prefix="localhost_access_log." suffix=".txt"               pattern="%h %l %u %t &quot;%r&quot; %s %b" /></Host><Host name="pay.aa.com"  appBase="pay"            unpackWARs="true" autoDeploy="true">        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"               prefix="localhost_access_log." suffix=".txt"               pattern="%h %l %u %t &quot;%r&quot; %s %b" /></Host>

nginx 配置

#user nobody设置 为 user rootserver {        listen       80;        server_name  www.aa.com;    location / {                #proxy_pass http://www.aa.com:8080/official-website/index.html;                root   html/official-website;                index  index.html;            }    location /manager {        proxy_pass http://www.aa.com:8080/manager;        root   html;        index  index.html index.htm;    }}server {        listen       80;        server_name  pay.aa.com;    location /examples {        proxy_pass http://pay.aa.com:8080/examples;        #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  100m;            root   html;            index  index.html index.htm;        }    }  server {            listen       80;            server_name  demo.aa.com;        location / {                    root   html/mould-sht;                    index  index.html;                }    }
原创粉丝点击