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 "%r" %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 "%r" %s %b" />
</Host>
nginx 配置
#user nobody
设置 为 user root
server {
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;
}
}