Introduction to Ansible Transcripts
Chapter: Deployments
Lecture: Fixing Our Nginx Configuration

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Let's make a few final tweaks to our web servers so that we can get that Nginx server up and running. Head under roles/webserver/tasks
0:12 Let's modify nginx. So, a couple things that we want to do here. Nginx is not currently up and running
0:17 but one thing that is useful is we can use the handler that we created for supervisor, and add it here. So, when we update our Nginx configuration
0:25 we can make sure to restart Nginx. Okay, so the issue really is in the template. We have a couple of variables here
0:35 that are messing up our ability to start the server. Remove those two resolver lines. Save the file. And now, let's run our playbook again
0:43 starting from the beginning. All right, so Nginx is still having an issue restarting. Let's scope out what the current issue is.
1:06 sudo -i for interactive superuser mode. Let's take a look at the log file and I can pretty much guarantee that this is a typo.
1:16 It should have been app_server. Let's go tweak that now. The one other issue in here, is that we need the upstream appserver_wsgi_app
1:30 to match what is down here for the proxy. But there is a typo appserver_wsgi_app. We can fix it, either place.
1:38 Let's, we'll just fix it up here, wsgi_app. Try this one more time from the beginning so we can make sure that we set our Nginx configuration properly.
1:53 We should be able to access ansibledeploymentexample.com. All right, and getting very close. There's an issue with the cipher suite
2:02 but this is a good sign because we have Nginx up and running. Move back over, and let's just update this configuration.
2:13 One thing to note, if you have problems with the cipher suite, use a different set of ciphers. And copy and paste this bit here.
2:49 All right, and we're almost there but we clearly have some 404 errors that are creepin' in that can't be served up.
2:57 We just need to fix the static asset serving and the webpage will look as we expect.


Talk Python's Mastodon Michael Kennedy's Mastodon