So I want a setup where the user has a primary access (site1) and from there, if they click an icon, they are routed somewhere else (Which is actually roundrobin'd between 2 sites, sites3/4).
so SITE1 is:
upstream backend1 {
server ip:<SITE2>;
}
server {
server_name localhost;
listen <SITE1>;
root /srv/dev_site1/www;
access_log /var/log/nginx/access_dev_site1.log;
error_log /var/log/nginx/error_dev_site1.log;
location / {
add_header a b;
}
location = /site1/{
proxy_pass http://backend1;
}
}
SITE2 is:
upstream backend {
server ip:<SITE3>;
server ip:<SITE4>;
}
server {
server_name localhost;
listen <SITE2>;
root /srv/dev_site2/www;
access_log /var/log/nginx/access_dev_site2.log;
error_log /var/log/nginx/error_dev_site2.log;
location /{
proxy_pass http://backend;
}
where SITE3 and SITE4 are identical in data.
I feel like something is redundant in the above. In addition, I want to make it somehow such that if in site 1 I have a location where its /siteX/, where it gets routed to can have the url stripped of the /siteX/, and the url contains only the base site + the URI hope this is clear..
thanks for any input.
so SITE1 is:
upstream backend1 {
server ip:<SITE2>;
}
server {
server_name localhost;
listen <SITE1>;
root /srv/dev_site1/www;
access_log /var/log/nginx/access_dev_site1.log;
error_log /var/log/nginx/error_dev_site1.log;
location / {
add_header a b;
}
location = /site1/{
proxy_pass http://backend1;
}
}
SITE2 is:
upstream backend {
server ip:<SITE3>;
server ip:<SITE4>;
}
server {
server_name localhost;
listen <SITE2>;
root /srv/dev_site2/www;
access_log /var/log/nginx/access_dev_site2.log;
error_log /var/log/nginx/error_dev_site2.log;
location /{
proxy_pass http://backend;
}
where SITE3 and SITE4 are identical in data.
I feel like something is redundant in the above. In addition, I want to make it somehow such that if in site 1 I have a location where its /siteX/, where it gets routed to can have the url stripped of the /siteX/, and the url contains only the base site + the URI hope this is clear..
thanks for any input.