So, I'm learning django using the book "TDD with Python" and in the chapter I am, we have to deploy an app to the live internet.
I have an instance up and running (ubuntu) in amazon web services. It has its own elastic IP already. I log into it using ssh from bash.
I installed a VE in the server and another directory containing my django project. All of this is well wired because I can start the development server with django (python3 manage.py runserver)
I'm supposed to config nginx so when the server receives an http request, It is passed along to django (http://localhost:8000/). Then django can take it from here.
Following the book's indications, I created a file at server: /etc/nginx/sites-available/MY-SERVER-ELASTIC-IP
with the following code:
server {
listen 80;
server_name superlists-staging.ottg.eu;
location / {
proxy_pass http://localhost:8000;
}
}
Then I created a symlink to the 'enabled-sites' directory using:
My-username@server:$ sudo ln -s ../sites-available/SERVER-ELASTIC-IP \
/etc/nginx/sites-enabled/SERVER-ELASTIC-IP
My aws instace accepts http and https requests from any host.
Please help me to see the (probably obvious) solution to this faulty config because it's really killing me.
Thank you.
Aucun commentaire:
Enregistrer un commentaire