比如 我有一个域名时https://a.com ,我可不可以通过nginx配置实现如下效果那?
https://a.com/a ------- 一个webman http://127.0.0.1:6001 https://a.com/b ------- 一个webman http://127.0.0.1:6002 https://a.com/c ------- 一个webman http://127.0.0.1:6003
嗯,就是这样,求指导
upstream a { server 127.0.0.1:6001; keepalive 10240; } upstream b { server 127.0.0.1:6002; keepalive 10240; } server { server_name 站点域名; listen 80; access_log off; root /your/webman/public; location ^~ /a { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Connection ""; if (!-f $request_filename){ proxy_pass http://a; } } location ^~ /b { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Connection ""; if (!-f $request_filename){ proxy_pass http://b; } } }