GithubHelp home page GithubHelp logo

部署在远程服务器 about picuploader HOT 2 CLOSED

D-MinGao avatar D-MinGao commented on June 27, 2024
部署在远程服务器

from picuploader.

Comments (2)

xiebruce avatar xiebruce commented on June 27, 2024

后台是一个网页,当然是通过域名打开了(说白了就是通过“网址”打开),网址是什么?你自己定呀。两种方法:

  1. 如果在本地部署,不是要修改hosts文件吗?所以你在hosts文件里写上:
127.0.0.1       api.picuploader.com

其中这意思就是告诉浏览器,api.picuploader.com这个“网址”对应的ip是“127.0.0.1”,也就是本机ip(为什么127.0.0.1是本机ip,这是规定的,任何电脑/手机上的127.0.0.1都表示本机)

而现在你部署到了服务器上,你服务器肯定有一个ip吧?假设你服务器ip是23.45.67.78,那么你只要把hosts文件改成下面这样就ok了:

23.45.67.78       api.picuploader.com

当然,api.picuploader.com是对应你服务器上nginx配置文件里的server_name


  1. 第1种方法需要你在每台要访问api.picuploader.com的电脑上都修改hosts文件并填上上述所说的内容,否则是打不开的。如果你不想这样,那就得注册一个域名,然后在域名注册服务商(比如阿里云)那里是可以指定你的域名对应的ip的,当然域名就不可能是api.picuploader.com了,比如你注册的域名是example.com,那你就添加一条www.example.com的记录,把它指向你服务器的ip23.45.67.78,并且你服务器的nginx配置文件的server_name值是www.example.com就行了。不过注册的域名是要认证也是要花钱的(每年都要交线)。

from picuploader.

D-MinGao avatar D-MinGao commented on June 27, 2024

好的,谢谢大佬

from picuploader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.