Heim  >  Fragen und Antworten  >  Hauptteil

Python – Flask-Blog Domainnamen hinzufügen

Ich habe selbst einen Flask-Blog geschrieben und ihn mit Gunicorn + Nginx auf VPS bereitgestellt. Normalerweise kann die Anmeldung mit IP normal angezeigt werden.
Ich habe den Domainnamen adoubi.life und den DNSpod-Domainnamen auf GOdaddy gekauft.
Da ich diesen Inhalt nicht sehr gut verstehe, beziehen sich alle Suchanfragen im Internet auf Flask-URL-Domainnamen.
Ich hoffe, einige bekannte Freunde können mir helfen, vielen Dank an alle.

给我你的怀抱给我你的怀抱2712 Tage vor678

Antworte allen(3)Ich werde antworten

  • 習慣沉默

    習慣沉默2017-05-18 10:48:44

    你搜索一下 “域名怎么绑定ip” 就有相关答案了,这个和flask关系不大,和nginx有一些关系,比如这是我的部分设置

    server  {
             listen 80;
             # 域名这样子配置
             server_name rookiefly.cn;
    
             location / {
                     try_files $uri @gunicorn_proxy;
             }
    
             location @gunicorn_proxy{
                     proxy_set_header X_Forwarded-For $proxy_add_x_forwarded_for;
                     proxy_set_header Host $host;
                     proxy_redirect off;
                     proxy_pass http://127.0.0.1:4359;
         }
    }

    Antwort
    0
  • PHPz

    PHPz2017-05-18 10:48:44

    自己弄出来了,在DNSpod添加域名解析的时候,把自己的VPS IP填写清楚就可以了。

    Antwort
    0
  • PHPz

    PHPz2017-05-18 10:48:44

    域名绑定到nginx上面的,
    跟flask没关系
    nginx就相当于一个反向代理

    Antwort
    0
  • StornierenAntwort