How to do it...

We're going to change the port on which NGINX listens by default, to show how much of a pain SELinux can be.

First, check that NGINX is running on port 80 (the default) by using curl and printing the return code:

$ curl -I localhost:80 HTTP/1.1 200 OKServer: nginx/1.12.2Date: Mon, 29 Oct 2018 17:36:35 GMTContent-Type: text/htmlContent-Length: 3700Last-Modified: Tue, 06 Mar 2018 09:26:21 GMTConnection: keep-aliveETag: "5a9e5ebd-e74"Accept-Ranges: bytes
Using -I here means that we don't pull in a screen full of code, and instead we just get the pertinent information, like the return code (200 being OK).

Cool, so that's all working normally, and SELinux isn't getting in the way.

What if we want NGINX to listen on a different ...

Get Linux Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.