www.a.com 请求访问/data/lafaso/a/ 目录
www.b.com 请求访问/data/lafaso/b/ 目录
可以通过
127.0.0.1:8080/a 和 127.0.0.1:8080/b 访问
我在配置Nginx的时候
proxy_pass http://10.1.1.201:8080;
这个地方写成
proxy_pass http://10.1.1.201:8080/a/;
但是验证没有通过,完整的配置文件
#user nobody;
worker_processes 1;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /usr/local/nginx/logs/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
#server_name localhost;
server_name www.android.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
#root html;
#index index.html index.htm;
proxy_pass http://10.1.1.201:8080/a/;
}
#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;
}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
server {
listen 80;
server_name www.iphone.com;
location / {
#root html;
#index index.html index.htm;
proxy_pass