│ │ ├── database │ │ │ └── db.sqlite3 │ │ ├── source │ │ │ ├── manage.py │ │ │ ├── superlists │ │ │ ├── etc... │ │ │ │ │ ├── static │ │ │ ├── base.css │ │ │ ├── etc... │ │ │ │ │ └── virtualenv │ │ ├── lib │ │ ├── etc... │ │ │ ├── www.staging.my-website.com │ │ ├── database │ │ ├── etc...
Following along in the " Simple Nginx Configuration" section I add a file inside of /etc/nginx/sites-available entitled staging.nickmorton.me with the following text:
server {
listen 80;
server_name staging.nickmorton.me;
location / {
proxy_pass http://localhost:8000;
}
}
after linking this file to /etc/nginx/sites-enabled and removing the default from sites-enabled my directories are in the following state:
|--- etc
| |--- ngingx
| | |--- sites-available
| | | |--- default staging.nickmorton.me
| | |--- sites-enabled
| | | |--- staging.nickmorton.me
On the command line I run: ps aux | grep nginx
as well as: ps aux | grep manage
Just to be sure that there are no active instances of Django or nginx.
Then I run the following
: sudo systemctl start nginx
: sudo systemctl reload nginx
Then I run ../virtualenv/bin/python3 manage.py runserver
and the Django server spins up without an error.
When I go to view the webpage in a browser (tried chrome and firefox) at staging.nickmorton.me (also tried just using the ip address) I get the following error: ERR_CONNECTION_REFUSED
Running sudo nginx -t does not detect any nginx config errors.
The nginx error log does seem helpful, reading as follows: (note that I'm on EST and it is only 1/12/17 today, could the problem be caused by the systems date/time config?)
2017/01/13 01:49:02 [notice] 5572#5572: signal process started
2017/01/13 01:49:22 [notice] 5582#5582: signal process started
2017/01/13 01:54:14 [notice] 5631#5631: signal process started
2017/01/13 02:48:11 [notice] 5730#5730: signal process started
I tried to be painstakingly specific here in hopes that someone with a better eye may spot an error somewhere along this process, or perhaps there is an advisable path to pursue in an effort to resolve this piping issue.
ps Thanks for a great book Harry, enjoying it so far and feeling very motivated to truly deploy the project!
Hmmm. Connection refused is strange. If nginx is working but it cant talk to django for whatever reason, you usually see 504 bad gateway. Connection refused feels like the request isnt even making it to nginx... did you ever see the default nginx "welcome to nginx" page? Have you tried rebooting? Could therre be any sort of firewall in the way?
--
You received this message because you are subscribed to the Google Groups "Obey the testing goat! Test-Driven Web Development with Python book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-go...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Harry Percival
+44 78877 02511
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-goat-book+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.