
コマンドでアプリを実行すると、python sorteerhoed.py && uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi:app
正常に実行され、サーバー ip:5000 にアクセスするとページが表示されます。ただし、systemctl を使用してサーバーをデーモン化しようとすると、起動はしますが、ログにエラーが表示されます。(http://prntscr.com/psyd02) そして、nginxで設定したウェブサイトにアクセスすると、「内部サーバーエラー」と表示されます。
これを私の設定ファイルとして使用します:
私の nginx conf ファイル: http://prntscr.com/psye25
私のsorteerhoed.iniファイル: http://prntscr.com/psyb1l
私のsorteerhoed.serviceファイル: http://prntscr.com/psybjq
私のwsgi.pyファイル: http://prntscr.com/psyg2q
nginx を使用して uWSGI をインストールするには、次のガイドに従いました。https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-18-04 また、別のスレッドで提案されているように、別の方法を使用して wsgi.py ファイルにアプリをインポートしようとしましたが、うまくいきませんでした。