Welcome! Log In Create A New Profile


ningx reverse proxy by dynamic port mapping

Posted by v3ss0n 
ningx reverse proxy by dynamic port mapping
July 17, 2009 09:57PM
Hi all,

I am trying to make a dynamic reverse proxy which proxies the local
webservers on different ports

I try doing this way :

#user nobody;
worker_processes 1;

#pid logs/nginx.pid;

events {
worker_connections 1024;

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

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
server_name _;
access_log /var/log/nginx/proxy.access.log;

location /
set $rd_port $arg_port;
proxy_set_header Host $proxy_host;


error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;

So when the page is requested using eg.
., it will redirect to http service running on 12345 . It work as expect
but only for one dynamic page / requested page, If that page have source
other static contents from its own it fails .

So to be make it possible need to put ?port=12345 on every links ,
images , etc.

How can i make it work as normally ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready