1

On most webserver configurations, .php files are automatically processed when a user accesses a php file, using php-fpm.

I'd like to do a similar thing for Flask apps on my nginx server, so that when a user accesses a .py file or a directory with an index.py file, the Flask app is automatically run.

What config would be necessary for this, under a nginx server on Ubuntu?

Luke Taylor
  • 151
  • 7
  • This isn't how Python apps work. You need a wsgi interpreter, which is separate from nginx. – EEAA Jun 22 '16 at 18:16
  • @EEAA Couldn't I configure `nginx` to automatically use a WSGI interpreter on a Python script, given certain static things like the main Flask instance being named `app`? – Luke Taylor Jun 22 '16 at 18:17
  • @EEAA It seems to me like the wsgi interpreter is roughly parallel to PHP's `php-fpm`, or am I mistaken? – Luke Taylor Jun 22 '16 at 18:18

0 Answers0