配置nginx反向代理,实现api.x.com域名代理本地9001端口

vi /apps/nginx/conf/conf.d/test.conf

server {
        listen 80;
        server_name api.x.com;

        location / {
            proxy_pass http://127.0.0.1:9001;
        }
}
server {
        listen 9001;
        server_name 127.0.0.1;

        location / {
            root /data/php;
            index api.html index.html;
    }
}

你可能感兴趣的:(配置nginx反向代理,实现api.x.com域名代理本地9001端口)