LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-24-2011, 03:48 PM   #1
martdj
Member
 
Registered: Feb 2005
Distribution: Fedora 20
Posts: 33

Rep: Reputation: 1
How to configure nginx as replacement for Pound?


Hi all,
As Pound is broken under Fedora 15, which I'm running on my Linux server, I decided to try out nginx and move the Pound configuration to something in nginx which does the same. However, the nginx configuration is a lot more complex than in Pound. What I try to do:
- nginx will listen on port 80
- requests for www.mydomain.nl => Domino HTTP server (on different server)
- if this server is not reachable, go to another Domino HTTP server
- requests for mail.mydomain.nl should preferably be redirected to HTTPS
- requests for tv.mydomain.nl should be redirected to port 9981 of my tvheadend server
- requests for torrent.mydomain.nl should be redirected to my download server on port 9091

There are a couple of other applications similar to the last two which should be reachable on their own subdomain.

I've installed nginx straight from the Fedora repositories. As I'm moving to nginx it would be nice to start using stuff like gzip compression, the proxy possibilities and ultimately ssl, but for now the proper redirection of all websites is the most important. Any help would be appreciated
 
Old 07-25-2011, 02:07 PM   #2
martdj
Member
 
Registered: Feb 2005
Distribution: Fedora 20
Posts: 33

Original Poster
Rep: Reputation: 1
I guess my question isn't clear enough. I'll try to clarify. Currently I have this as default.conf in the conf.d dir:
Quote:
# primary server - proxypass to martdj
server {
listen 80;
server_name www.mydomain.nl;

access_log on;
error_log on;

# proxy to Apache 2 and mod_python
location / {
proxy_pass http://192.168.7.100:80/;
proxy_redirect off;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 0;

client_max_body_size 50m;
client_body_buffer_size 128k;

proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;

proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
This forwards all http traffic to 192.168.7.100, but that's not exactly what I want. I want only traffic that's not for a specific subdomain to be directed to this server, but how do I put these subdomains in so that those are directed to their subsequent IP adresses and ports. Is this also done in default.conf or should I put those in a different file in the conf.d dir? I've read the stuff at wiki.nginx.org, but I couldn't find this.
 
Old 07-31-2011, 02:01 PM   #3
martdj
Member
 
Registered: Feb 2005
Distribution: Fedora 20
Posts: 33

Original Poster
Rep: Reputation: 1
A quick update. I've figured out how to configure the different websites in nginx. Put your most used / fallback website in default.conf in the conf.d directory. Create the other websites as
server {
listen 80;
server_name torrent.mydomain.nl;

location / {
proxy_pass http://<mylocalip>:9091;
include /etc/nginx/proxy.conf;
}
}

Now I have to figure out the gzip and proxy settings
 
  


Reply

Tags
nginx



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 02:30 PM
NGINX with PHP-FPM vis NGINX with Spawn-FCGI WhisperiN Linux - Server 1 03-15-2011 06:39 PM
Configure Nginx under RHEL 5 jul_the Red Hat 7 09-29-2010 04:11 AM
Want to configure POUND load balancer. nishith Linux - Server 1 09-20-2008 05:41 AM
LXer: Linux configure pound reverse proxy for Apache http / https web server LXer Syndicated Linux News 0 12-14-2007 07:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration