OpenSeaMap-dev:Server FreeBSD Proxy

Aus OpenSeaMap-dev
Version vom 24. Dezember 2012, 13:33 Uhr von Dom (Diskussion | Beiträge) (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…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

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