Giter VIP home page Giter VIP logo

flask-test-nginx-reverse-proxy's Introduction

flask-test-nginx-reverse-proxy

uWSGIでなく revese proxyでアクセスできるようにした デバッグ用のコード。

app.confBASEDIRの値をいじる。

./start_flask.sh

で開始。 デバッグモード & オートリロード。ログは標準出力

./test_flask.sh

でテスト。簡単なHTMLが帰る。

オートリロードなのでrun.pyを編集すると再読込してくれる (モジュールに関しては不明)。

./stop_flask.sh

で終了

nginxとの連携

Debian/Ubuntuの場合/etc/nginx/proxy_paramsがある

  location /test1 {
    include /etc/nginx/proxy_params;
    proxy_pass http://localhost:4044/test1;
  }

TIPS: proxy_passの最後に/を入れない

nginx -tでテストして、 systemctl restart nginxでリロード。

ブラウザからアクセスしてみる。

これを書いた理由

FlaskのSSLの設定に自信がなかったから。

flask-test-nginx-reverse-proxy's People

Contributors

heiwa4126 avatar

Watchers

 avatar

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.