Welcome! Log In Create A New Profile

Advanced

Reverse Proxy, basic-basic config.

Posted by beaverfish 
Reverse Proxy, basic-basic config.
November 29, 2015 01:15PM
A IIS server is located on 172.16.16.11 thats host a website on port 80
My Nginx-server is located on 192.168.1.49. (CentOS 7)
The DNS server points to the 192.168.1.49 machine with the A record of www.test.com and test.com that should proxy to 172.16.16.11.

Can someone help me a very basic config? Just want a quick and dirty configuration. Been following some tutorials on the web, even the most basic tuts seems to be to complicated for me. ;-)

Im running this at the moment in my nginx.conf. Only those lines, do I need rest of the config to?

server {
listen 80;
location / {
proxy_pass http://172.16.16.11;
}
}
Re: Reverse Proxy, basic-basic config.
November 29, 2015 04:50PM
My whole nginx.conf looks like this:

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


#http {
# include /etc/nginx/mime.types;
# default_type application/octet-stream;

# log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

# access_log /var/log/nginx/access.log main;

# sendfile on;
#tcp_nopush on;

# keepalive_timeout 65;

#gzip on;

# include /etc/nginx/conf.d/*.conf;
#}

server {
listen 80;
server_name www.test.com;

access_log /var/log/nginx/access.log;


location / {
proxy_pass http://172.16.16.11/;
include /etc/nginx/proxy.conf;
}
}
Re: Reverse Proxy, basic-basic config.
November 29, 2015 05:10PM
If it works then leave it as it is, adding tuning parameters is always helpful but without knowing what to tune it makes no sense to add them all.

Query the users and check the logfiles to see if anything is misbehaving.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Reverse Proxy, basic-basic config.
November 29, 2015 05:17PM
I got it to work. Hmm, seems I had to use the /etc/nginx/conf.d/default.conf file to add it into.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 97
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready