I have a task to to install apache and nginx and run them on some respective ports
For apache I have changed port no. in /etc/httpd/conf/httpd.conf location but unable to change port for nginx.
I’m confused when to use /etc/nginx/nginx.conf and when to create default.conf file in /etc/ngnix/conf.d/ location.
settings of nginx as a reverse proxy help
while creating default.conf file in /etc/ngnix/conf.d/ location which lines are needed to be added to the file, I have read some articles but didn’t get why do they use above code while we add apache as reverse proxy
First you need to install apache
yum install httpd
Configure it on port as given in Q.
For that you need to change /etc/httpd/conf/httpd.conf file and edit listen parameter.
Restart the httpd service.
For nginx, you need to install nginx on server using,
yum install epel-release
yum install nginx
then you need to configure some parameter in nginx.conf located at /etc/nginx
Edit the file and change below parameters according to your question.
listen 80996;
listen [::]:8096;
server_name 172.16.238.16;
Under location tab, add below line
proxy_pass http://72.16.238.16:5003
Start the nginx service.
Check the web page by using curl command
Please make sure before submitting task you have completed all the sub questions asked in task.
Hello, pratikshag
Can you check the output of journalctl -xe -u nginx. It’s look like you have done something wrong in the configuration of nginx.
Check the port of nginx which one is assigned. It’s opted by nginx service or other’s service. (netstat command)
@player001…I am doing some mistake in nginx.conf file(in location section)…If i removed pass proxy from location its not giving error…plz check…I am attaching the screenshot…