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
0:02 so that we can get that Nginx server up and running.
0:05 Head under roles/webserver/tasks
0:11 Let's modify nginx.
0:12 So, a couple things that we want to do here.
0:14 Nginx is not currently up and running
0:16 but one thing that is useful is we can use the handler
0:18 that we created
0:20 for supervisor, and add it here.
0:22 So, when we update our Nginx configuration
0:24 we can make sure to restart Nginx.
0:28 Okay, so the issue really is in the template.
0:33 We have a couple of variables here
0:34 that are messing up our ability to start the server.
0:36 Remove those two resolver lines.
0:38 Save the file.
0:40 And now, let's run our playbook again
0:42 starting from the beginning.
0:52 All right, so Nginx is still having an issue restarting.
0:57 Let's scope out what the current issue is.
1:05 sudo -i for interactive superuser mode.
1:08 Let's take a look at the log file
1:12 and I can pretty much guarantee that this is a typo.
1:15 It should have been app_server.
1:17 Let's go tweak that now.
1:25 The one other issue in here, is that we need
1:26 the upstream appserver_wsgi_app
1:29 to match what is down here for the proxy.
1:32 But there is a typo appserver_wsgi_app.
1:36 We can fix it, either place.
1:37 Let's, we'll just fix it up here, wsgi_app.
1:41 Try this one more time from the beginning
1:42 so we can make sure that we set
1:43 our Nginx configuration properly.
1:52 We should be able to access ansibledeploymentexample.com.
1:57 All right, and getting very close.
1:59 There's an issue with the cipher suite
2:01 but this is a good sign
2:02 because we have Nginx up and running.
2:03 Move back over, and let's just update this configuration.
2:12 One thing to note, if you have problems
2:13 with the cipher suite, use a different set of ciphers.
2:16 And copy and paste this bit here.
2:48 All right, and we're almost there
2:49 but we clearly have some 404 errors that are creepin' in
2:52 that can't be served up.
2:56 We just need to fix the static asset serving
2:58 and the webpage will look as we expect.