I cant run flask app as default un site

Hello. I had a default site that cyberpanel give me when i register the first Time . Its run with php8.

I had change the virtual host config to run Python flask but it always run php. I cant do this works by default flask app un port 80 ir 443.

Anybody can help me?

can you share your vhsot configrations?

Yes! This is.

context /.well-known/acme-challenge {
  location                /usr/local/lsws/Example/html/.well-known/acme-challenge
  allowBrowse             1

  rewrite  {
     enable                  0
  }
  addDefaultCharset       off
  phpIniOverride  {

  }
}

vhssl  {
  keyFile                 /etc/letsencrypt/live/vps-1978922-x.dattaweb.com/privkey.pem
  certFile                /etc/letsencrypt/live/vps-1978922-x.dattaweb.com/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling           1
  ocspRespMaxAge           86400
}

context / {
type appserver
location /home/vps-1978922-x.dattaweb.com/public_html
binPath  /usr/local/lsws/fcgi-bin/lswsgi
Application Type  WSGI
Startup File  wsgi.py
envType                 1
env    PYTHONPATH=/home/vps-1978922-x.dattaweb.com/public_html/lib/python3.8:/home/vps-1978922-x.dattaweb.com/public_html
env     LS_PYTHONBIN= /home/vps-1978922-x.dattaweb.com/public_html/bin/pyhton
}

i saw differents way to config but anyone works for me.

I would suggest that run flask with gunicorn and then use reverse proxy: Gunicorn — Flask Documentation (3.0.x)

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.