Linux nginx as Reverse Proxy - Easiest way of doing it

I have to admit I am a little frustrated with the lack of clarity in these proposed solutions. Why add all those extra options in /etc/nginx/conf.d when they aren’t even mentioned in the task? Especially since no one actually explains what they do? Don’t get me wrong, I appreciate the effort this community puts into teaching newbies, but since I am a beginner myself, I really think we would all benefit from simple, to the point and well explained solutions. In order to succeed in this task, I had to waste a full hour doing forensic work. It felt like playing Monkey Island or something. The first thing that a new user needs to understand about this task is what nginx does for Apache. From what I understand, it acts as a privacy filter against requests that are coming in from outside the network. For that to work, you need to instruct both Apache (httpd) and reverse-proxy (nginx) on how to communicate.

Anyway, I’ll stop ranting now, here’s a sample of how I think this should be done on RHEL:

ssh clint@stbkp01

sudo yum install epel-release httpd -y

sudo yum install nginx -y

sudo vi /etc/httpd/conf/httpd.conf

Modify this field : LISTEN 8087

Activate & modify this field : ServerName


sudo vi /etc/nginx/nginx.conf

server {

Modify this field : listen 8091 default;
Modify this field : server_name;
Remove this field: /usr/share/nginx/html;


location / {

Add this field : root /var/www/html;
Add this field : proxy_pass;



sudo restart nginx; sudo restart httpd;

Second window, on thor:

sudo scp /home/index.html clint@stbkp01:/tmp

back on clint@stbkp01:

sudo cp /tmp/index.html /var/www/html

back on thor: