我在以下网址上有一个包含3个网络应用的服务器:
我想重写所有这些网址,看起来像这样:
所以我编辑了我的nginx.conf:
worker_processes 1;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location /sonar/ {
proxy_pass http://localhost:9000/;
}
location /tomcat/ {
proxy_pass http://localhost:8080/;
}
location /jenkins/ {
proxy_pass http://localhost:7000/;
}
}
}
因为这些文件位于localhost / appName / css或image上,并且调用的url是localhost / css或image。有人可以告诉我如何重写所有这个网址?