Read me with gunicorn -env SCRIPT_NAME=/watermarks - now for REAL

watermarks_url_path
Castro0o 5 years ago
parent e101ad4ad6
commit dc73be8811

@ -7,12 +7,12 @@
**Using gunicorn:** **Using gunicorn:**
`gunicorn -w 4 -b 127.0.0.1:5000 app:app` `gunicorn --env SCRIPT_NAME=/watermarks -w 4 -b 127.0.0.1:5000 app:app --log-level debug`
* `-w` workers * `-w` workers
* `-b` bind to address / unix socker * `-b` bind to address / unix socker
**And gunicorn with using unix sock:** (this how it should run in production) **And gunicorn with using unix sock:** (this how it should run in production)
`gunicorn --workers 4 --bind unix:app.sock -m 007 app:app ` ` gunicorn --env SCRIPT_NAME=/watermarks --workers 4 --bind unix:app.sock -m 007 app:app --log-level debug
## in Production with gunicorn and unix sockets ## in Production with gunicorn and unix sockets
Based on https://medium.com/faun/deploy-flask-app-with-nginx-using-gunicorn-7fda4f50066a Based on https://medium.com/faun/deploy-flask-app-with-nginx-using-gunicorn-7fda4f50066a
@ -73,3 +73,17 @@ and the start following app.log:
`tail -f /var/www/TacticalApp/app.log` `tail -f /var/www/TacticalApp/app.log`
But in the long run logging should be disabled But in the long run logging should be disabled
----
09.06.2020 Handling url path /watermarks
* gunicorn has to be started with argument `--env SCRIPT_NAME=/watermarks` which defines its path:
`gunicorn --env SCRIPT_NAME=/watermarks --workers 4 --bind unix:app.sock -m 007 app:app --log-level debug`
* allows for the following URLs
* http://127.0.0.1/watermarks
* http://127.0.0.1/watermarks/uploadbook
* http://127.0.0.1/watermarks/about
* added pages /test and
* make urls relative

Loading…
Cancel
Save