Also, I have nginx proxying sabnzbd, sickbeard, couchpotato, and maraschino. If anyone wants to do something similar this post may be helpful.
In jail
Code:
pkg_add -r nginx
echo 'nginx_enable=YES' >> /etc/rc.conf
my /usr/local/etc/nginx/nginx.conf
Code:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
include usenet.conf;
}
my /usr/local/etc/nginx/usenet.conf
Code:
server {
listen 80;
#I needed this for my varnish web loadbalancer to have a test url, this isn't normally needed
location /index.html {
root /usr/local/www/nginx;
}
#I redirect my main domain to maraschino
location / {
rewrite ^ /maraschino permanent;
}
location /maraschino {
proxy_pass http://127.0.0.1:7000;
include proxy.conf;
}
location /sabnzbd {
proxy_pass http://127.0.0.1:8080;
include proxy.conf;
}
location /sickbeard {
proxy_pass http://127.0.0.1:8081;
include proxy.conf;
}
location /couchpotato {
proxy_pass http://127.0.0.1:5050;
include proxy.conf;
}
}
my /usr/local/etc/nginx/proxy.conf
Code:
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Sabnzbd already has both '/' and '/sabnzbd' as it's webroot. For Sickbeard I added '/sickbeard' as the webroot in the config.ini. In Couchpotato v2 I added 'couchpotato' as the webroot under General > Advanced (with 'Show advanced settings' checked). In maraschino I added 'maraschino' as the webroot (I needed this because the sickbeard module for maraschino uses the webdirectory sickbeard and was casuing errors. I don't currently have headphones setup on my production system.
To start nginx
Code:
service nginx start
I can see everything locally from jailip/program_name