Skip to content

Instantly share code, notes, and snippets.

@vchrombie
Last active July 19, 2024 22:43
Show Gist options
  • Save vchrombie/2406bbefc4926b7550fbad46a2c43cfa to your computer and use it in GitHub Desktop.
Save vchrombie/2406bbefc4926b7550fbad46a2c43cfa to your computer and use it in GitHub Desktop.
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"HEAD",
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
[program:gunicorn]
directory=/home/ubuntu/myblog
command=/home/ubuntu/env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/myblog/app.sock myblog.wsgi:application
autostart=true
autorestart=true
stderr_logfile=/var/log/gunicorn/gunicorn.err.log
stdout_logfile=/var/log/gunicorn/gunicorn.out.log
[group:guni]
programs:gunicorn
@vineelareddy0410
Copy link

[program:gunicorn]
directory=/home/ubuntu/todo
command=/home/ubuntu/todo/venv/bin/gunicorn --bind 0.0.0.0:8000 my_django_project.wsgi:application  
autostart=true
autorestart=true
stderr_logfile=/var/log/gunicorn/gunicorn.err.log
stdout_logfile=/var/log/gunicorn/gunicorn.out.log
environment=PATH="/home/ubuntu/todo/venv/bin",VIRTUAL_ENV="/home/ubuntu/todo/venv",PYTHONPATH="/home/ubuntu/todo"

[group:guni]
programs:gunicorn

@vchrombie
Copy link
Author

@vineelareddy0410
Copy link

server {
    listen 80;
    server_name ec2-18-224-25-219.us-east-2.compute.amazonaws.com;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/ubuntu/todo;
    }

    location / {
        proxy_pass http://127.0.0.1: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;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    error_log /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment