Created
July 15, 2019 19:09
-
-
Save kvfi/a2a2b5db5985f542d1f1aed8e9a7c647 to your computer and use it in GitHub Desktop.
Deployment configuration for Flask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.com; | |
location / { | |
proxy_pass http://unix:/path/to/socket.sock; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
fastcgi_read_timeout 300s; | |
proxy_read_timeout 300; | |
} | |
location /static { | |
alias /path/to/static/folder | |
} | |
error_log /var/log/nginx/example-error.log; | |
access_log /var/log/nginx/example-access.log; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Gunicorn instance to serve flask app | |
After=network.target | |
[Service] | |
User=kvfi | |
Group=nginx | |
WorkingDirectory=/path/to/dir | |
Environment="PATH=/path/to/dir/venv/bin" | |
ExecStart=/path/to/dir/venv/bin/gunicorn --workers 3 --bind unix:/path/to/dir/flask.sock -m 007 wsgi | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment