search

Home  >  Q&A  >  body text

node.js - How to configure nginx to directly access www.abd.com/node/dist/index.html through www.abd.com

1. The question is as stated in the title, thank you all for your answers!

某草草某草草2829 days ago968

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-06-22 11:56:29

    server {
        listen       80;
        server_name  www.abd.com;
        location / {
            root     /项目目录/node/dist;
            index    index.html;
        }
    }

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-22 11:56:29

    Added: server_name can be arbitrary:

    server {
        listen       80;
        server_name  www.abd.com;
        location /{
            proxy_pass  http://www.abd.com/node/dist/index.html;
        }        
    }    

    Of course, you can also use redirects

    reply
    0
  • Cancelreply