layui用nginx 反向代理配置

root配置到start上一级文件路径,不需要配置index,访问的时候http://localhost:端口号/start/index.html

listen       8081;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location /* {
            proxy_pass http://127.0.0.1:9000;
        }

	location  ~ .*\.(flv|xlsx|xls|eot|woff2|woff|ttf|svg|sql|mp4|m4v|swf|ico|json|apk|gif|png|jpg|jpeg|map|html|images|javascript|js|css|less|flash|media|static)$ {
	    root  E:\project\2-group-projects\ShengRenMinYiYuanFront\ShengRenMinYiYuanFront;
        }

	# 需要更改rewrite 请求路径的配置
        location /api/ {
	   # API Server
	   proxy_pass http://127.0.0.1:9000;
        }

猜你喜欢

转载自blog.csdn.net/zhongmei121/article/details/97919107