OpenSeaMap-dev:Server FreeBSD Proxy: Unterschied zwischen den Versionen

Aus OpenSeaMap-dev
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „== Installation == === Host === Add redirection for port 80. vi /etc/pf.conf rdr on $ext_if proto tcp from any to any port 80 -> 127.0.0.10 pass in o…“)
 
K (Markus verschob Seite Server FreeBSD Proxy nach OpenSeaMap-dev:Server FreeBSD Proxy, ohne dabei eine Weiterleitung anzulegen)
 
(kein Unterschied)

Aktuelle Version vom 30. Januar 2013, 15:06 Uhr

Installation

Host

Add redirection for port 80.

vi /etc/pf.conf
  rdr on $ext_if proto tcp from any to any port 80 -> 127.0.0.10
  pass in on $ext_if inet proto tcp from any to 127.0.0.10 port 80

pfctl -f /etc/pf.conf

Jail

Install ports.

screen -S ports
portmaster -d -B www/nginx
exit

Configure service to startup at boot.

vi /etc/rc.conf
  nginx_enable="YES"

Create default nginx configuration.

vi /usr/local/etc/nginx/nginx.conf
  user nobody;
  worker_processes  1;

  events {
    worker_connections  1024;
  }

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

    server_tokens off;

    sendfile        on;

    keepalive_timeout  65;

    # server configs here
  }

service nginx start

Maintenance

Add service.

vi /usr/local/etc/nginx.conf
  http {

    ...

    server {
       listen       80;
       server_name  <subdomain>.openseamap.org;
       
       location / {
           proxy_pass   http://127.0.0.xx;
       }
    }

    ...

  }

service nginx reload