nginx配置url转发

1,118 阅读1分钟

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {
        listen       80;
     
        location /a {
			rewrite ^/a/(.*)$ /$1 break;
			proxy_pass http://127.0.0.1:8080;
        }
		 location /b {
			rewrite ^/b/(.*)$ /$1 break;
			proxy_pass http://127.0.0.1:8081;
        }
		
    }
}

taskkill /fi "imagename eq nginx.EXE" /f    在windows下,可以杀掉nginx的进程