nginx and cscart
torajx
nginx-forum at nginx.us
Sat Jun 25 11:29:28 MSD 2011
hi,
i asked this question in other topics but did not get the complete
solution yet.
many problems solved but one final of pice of puzzle is still unsolved;
we want to use nginx in front of three cs cart web servers;
one server is for images(192.168.1.3) and two others(192.168.1.1,
192.168.1.2) for web site files of cscart..
this is my complete config so far :
user nginx nginx;
worker_processes 4;
error_log var/log/error.log;
pid var/run/nginx.pid;
events {
worker_connections 4098;
}
http {
keepalive_timeout 65;
include mime.types;
default_type application/octet-stream;
sendfile on;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml text/css;
gzip_disable "MSIE [1-6]\.";
upstream mysites_hash {
ip_hash;
server 192.168.1.1;
server 192.168.1.2 down;
}
upstream myimages {
server 192.168.1.3;
}
server {
listen 80;
server_name www.mydomain.com;
location / {
deny all;
}
location /csupdate/images {
proxy_pass http://myimages/images;
}
location /csupdate {
proxy_pass http://mysites_hash/csupdate;
proxy_set_header Host 192.168.1.1;
proxy_redirect http://192.168.1.1/csupdate
http://www.mydomain.com/csupdate;
}
location /nginx_status {
stub_status on;
access_log off;
allow my_own_ip-address;
deny all;
}
}
}
some notes :
1. cs cart has a setion in its config that i have to add server address
and also some path
for example i have to define 192.168.1.1 and also define "csupdate"
(csupdate is a virtual address of my site under 192.168.1.1 or
192.168.1.2); then cscart redirect users to this address so it does some
redirection so i need to use proxy_redirect ang proxy_set_header as
above;
2. the above config is working fine because i set the 2th server down
(192.168.1.2) and use 1th server address manually
in my /csupdate location but i can not enable my 2th server because
i don't know how to config my csupdate location
is there any thing i can do for this problem ???
thank you in advance;
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,209882,209882#msg-209882
More information about the nginx
mailing list