New to nginx: ssl/sticky/conditional proxying

Emarginated nginx-forum at nginx.us
Fri Mar 14 15:51:35 UTC 2014


Oh, well, thanks for the warm welcome!  :)
Just kidding, i'm going on reading documentantio and now i have a
semi-functional nginx.conf.
I miss something, so maybe someone coul help me on the "conditions".

I need to send IP to specific BACKEND server.


worker_processes 4;
worker_priority -1;
worker_rlimit_nofile 8192;
worker_cpu_affinity 0001 0010 0100 1000;
user              nginx;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    multi_accept on;
    worker_connections 4096;
}


http {
####SSL
  ssl_session_cache   shared:SSL:10m;
  ssl_session_timeout 10m;
  ssl_certificate     include/cert.pem;
  ssl_certificate_key include/key.pem;
  ssl_protocols       SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers         HIGH:!aNULL:!MD5;

###LOG
log_format apache
  '$remote_addr - $remote_user [$time_local] '
  '"$request" $status $body_bytes_sent '
  '"$http_referer" "$http_user_agent" '
  '"$http_cookie"';
  access_log /var/log/nginx/access.log      apache;

###### UPSTREAM
upstream apache{
  sticky;
  server localhost:81;
  server localhost:82;
  server localhost:83;
}

####CORE
server {
  listen *:80;
  listen *:443 ssl;
  keepalive_timeout   70;

#### REVERSE PRXYING
  location / {
  proxy_set_header Host $host;
  proxy_pass http://apache;  <-- do i send also HTTPS requestes?)
---> i see that connecting to nginx on port 443 redirect me to backend, but
not sure if it is running on https there).

  proxy_set_header X-Real-IP  $remote_addr;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_set_header Host $host;
  include /etc/nginx/mime.types;
  }
 }
}


Thank you.

Regards,

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,248320,248382#msg-248382



More information about the nginx mailing list