S
S
Snowindy2013-05-10 09:28:54
FreeBSD
Snowindy, 2013-05-10 09:28:54

FreeBSD: redirect all traffic from 80 to 8080 port

Available:
- FreeBSD 9.0 server,
- web server running on port 8080 (from a normal user, it's safer).

I want the web server to be accessible from port 80.

Since ports below 1024 are not available to unprivileged users, I read on the Internet that the most reasonable solution would be to simply redirect all traffic from port 80 to 8080.

How to do this with minimal effort for FreeBSD?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Petrikov, 2013-05-10
@Snowwindy

By means of IPFW

add номер правила fwd 127.0.0.1,8080 tcp from any to me dst-port 80

By means of PF
rdr on $ext_if proto tcp from any to me port 80 -> 127.0.0.1 port 3129

S
sumjohn, 2013-05-10
@sumjohn

Why not rebind the webserver to port 80? Redirection, IMHO, will only eat resources to no avail ...

M
middle, 2013-05-10
@middle

Usually, servers bind to port 80, and then they drop privileges and work as a regular user. Apache and nginx work exactly like this...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question