Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nginx config and update setup instruction #3

Open
kantegory opened this issue Apr 16, 2020 · 1 comment
Open

Add nginx config and update setup instruction #3

kantegory opened this issue Apr 16, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@kantegory
Copy link
Owner

I guess, it'll be UWSGI + NGINX for improving work of web-app.

It can helps: Bottle + UWSGI + Nginx Quickstart

@kantegory kantegory added the enhancement New feature or request label Apr 16, 2020
@kantegory
Copy link
Owner Author

kantegory commented Apr 24, 2020

NGINX + UWSGI

Install requirements:

epmi uwsgi uwsgi-plugin-python3 python3-bottle nginx

Then copy project dir to /var/www:

cp -r accreditation_system /var/www

UWSGI config

Let's create UWSGI config:

cd /etc/apps-available/ && nano accreditation.ini

And paste next lines:

[uwsgi]
socket = /run/uwsgi/app/accreditation/socket
chdir = /var/www/accreditation_system
master = true
plugins = python3
file = main.py
uid = www-data
gid = www-data

Then create a symlink:

ln -s /etc/uwsgi/apps-available/accreditation.ini /etc/uwsgi/apps-enabled/accreditation.ini

NGINX config

upstream _bottle {
    server unix:/run/uwsgi/app/accreditation/socket;
}

server {
    listen [::]:80;
    listen 80;
    server_name YourServerName;
    root /var/www/accreditation_system;

    location / {
        try_files $uri @uwsgi;
    }

    location @uwsgi {
        include uwsgi_params;
        uwsgi_pass _bottle;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant