This repository contains a simple Quiz App and the setup of Flask in Python WSGI HTTP Server.
Make sure you have the following installed:
- Python 3
- pip (Python package installer)
-
Clone the repository to your local machine:
git clone <repository_url>
-
Navigate to the project directory:
cd <project_directory>
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the Gunicorn server:
sudo gunicorn -w 4 -b 0.0.0.0:8000 app:app
Once the server is running, you can access the Quiz App by visiting http://<server_address>
in your web browser.
To deploy the Quiz App with NGINX, you can use the following configuration:
server {
listen 80;
server_name <server_domain>; # Replace with your domain name or server IP
location / {
proxy_pass http://127.0.0.1:8000; # Assuming Gunicorn is running on port 8000
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
}
}
sudo systemctl restart nginx