Formatting code for nginx
{{parent page="WebServer"}}
===nginx reverse proxy===
nginx = EngineX
==Install from source==
%%
./configure --with-http_ssl_module --with-poll_module \
--user=apache --group=apache --conf-path=/etc/nginx.conf \
--pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx.err \
--http-log-path=/var/log/nginx.log --http-proxy-temp-path=/var/cache/nginx/http \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi \
--http-client-body-temp-path=/var/cache/nginx/body \
--prefix=/usr --sbin-path=/usr/sbin
%%
==Minimum config==
%%
user apache;
worker_processes 2;
gzip on;
server {
listen 192.168.13.10:80;
server_name nginx.domain.tld;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
}
%%
==minimum linux init script==
%%
#!/bin/sh
. /etc/init.d/functions
pidfile=/var/run/nginx.pid
case $1 in
start)
daemon --pidfile $pidfile nginx
;;
stop)
killproc -p $pidfile
;;
esac
%%
Rewrite - http://wiki.codemongers.com/NginxHttpRewriteModule
Tune - http://wiki.nginx.org/FreeBSDOptimizations
SSL reverse proxy - http://www.linux-masters.com/2010/04/nginx-setup-ssl-reverse-proxy-load.html
===nginx reverse proxy===
nginx = EngineX
==Install from source==
%%
./configure --with-http_ssl_module --with-poll_module \
--user=apache --group=apache --conf-path=/etc/nginx.conf \
--pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx.err \
--http-log-path=/var/log/nginx.log --http-proxy-temp-path=/var/cache/nginx/http \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi \
--http-client-body-temp-path=/var/cache/nginx/body \
--prefix=/usr --sbin-path=/usr/sbin
%%
==Minimum config==
%%
user apache;
worker_processes 2;
gzip on;
server {
listen 192.168.13.10:80;
server_name nginx.domain.tld;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
}
%%
==minimum linux init script==
%%
#!/bin/sh
. /etc/init.d/functions
pidfile=/var/run/nginx.pid
case $1 in
start)
daemon --pidfile $pidfile nginx
;;
stop)
killproc -p $pidfile
;;
esac
%%
Rewrite - http://wiki.codemongers.com/NginxHttpRewriteModule
Tune - http://wiki.nginx.org/FreeBSDOptimizations
SSL reverse proxy - http://www.linux-masters.com/2010/04/nginx-setup-ssl-reverse-proxy-load.html