To create new wiki account, please join us on #znc at freenode and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Difference between revisions of "Reverse Proxy"

From ZNC
Jump to: navigation, search
m (Thor77 moved page ReverseProxy to Reverse Proxy)
m (Gavin moved page Reverse proxy to Reverse Proxy over redirect)
(4 intermediate revisions by 2 users not shown)
Line 16: Line 16:
 
     }
 
     }
 
}</nowiki>
 
}</nowiki>
== LightHTTPD ==
+
== lighttpd ==
 
  <nowiki>$HTTP["host"] =~ "^(sub\.domain\.com)$" {
 
  <nowiki>$HTTP["host"] =~ "^(sub\.domain\.com)$" {
 
   proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 6667 ) ) )
 
   proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 6667 ) ) )
 
}</nowiki>
 
}</nowiki>

Revision as of 22:09, 3 April 2017

If you want to use a subdomain for the ZNC-Webinterface, you have to create a Reverse Proxy with your webserver.
Without setting TrustedProxy in your config you will only see 127.0.0.1 or ::1 for each web-access in your logs => You can't block specific IP's
If you want to see the real IP's you have to add this to your config:

TrustedProxy = 127.0.0.1
TrustedProxy = ::1

Nginx

server {
    listen 80;
    listen [::]:80;
    server_name znc.domain.tld;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://[::1]:6667/;
    }
}

lighttpd

$HTTP["host"] =~ "^(sub\.domain\.com)$" {
  proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 6667 ) ) )
}