nginx virtual hosting and seaside

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

nginx virtual hosting and seaside

JupiterJones
Hi All,

i’m hoping someone has attempted this before to save me having to learn too much about nginx :)

I have multiple URL’s:
etc.

and multiple applications running in seaside:
etc.

This is the bit I don’t know about… Ideally I’d like the urls to map directly to the Seaside application. i.e.
www.site1.com serves the application at /Site1App
www.site2.com serves the application at /Site2App
etc.

in my nginx.conf I have:

upstream seaside {
    server 127.0.0.1:8383;
}
server {
listen 80;
server_name site1.com www.site1.com;
root /dev/null;
location / {
proxy_pass http://seaside;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header   Host $host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
server {
listen 80;
server_name site2.com www.site2.com;
root /dev/null;
location / {
proxy_pass http://seaside;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header   Host $host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
etc.

Does anyone know the missing piece of the puzzle?

Thanks in advance for any advice.

Cheers,

Jupiter



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: nginx virtual hosting and seaside

JupiterJones
To reply to my own question, this is how I’m doing it now, but would appreciate any advice from someone with more nginx experience.

upstream seaside {
    server 127.0.0.1:8383;
}

server {
listen 80;
server_name www.site2.com;
root /dev/null;

location @seaside {
proxy_pass http://seaside;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Host             $host;
proxy_set_header X-Real-IP        $remote_addr;
proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
}
location /Site1App {
try_files $uri $uri/ @seaside;
}
location /files/ {
try_files $uri $uri/ @seaside;
}
if ($uri = /) {
rewrite ^(.*)$ /Site1App$1 break;
}
}

On 31 Mar 2015, at 7:15 pm, Jupiter Jones <[hidden email]> wrote:

Hi All,

i’m hoping someone has attempted this before to save me having to learn too much about nginx :)

I have multiple URL’s:
etc.

and multiple applications running in seaside:
etc.

This is the bit I don’t know about… Ideally I’d like the urls to map directly to the Seaside application. i.e.
www.site1.com serves the application at /Site1App
www.site2.com serves the application at /Site2App
etc.

in my nginx.conf I have:

upstream seaside {
    server 127.0.0.1:8383;
}
server {
listen 80;
server_name site1.com www.site1.com;
root /dev/null;
location / {
proxy_pass http://seaside;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header   Host $host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
server {
listen 80;
server_name site2.com www.site2.com;
root /dev/null;
location / {
proxy_pass http://seaside;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header   Host $host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
etc.

Does anyone know the missing piece of the puzzle?

Thanks in advance for any advice.

Cheers,

Jupiter


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: nginx virtual hosting and seaside

Esteban A. Maringolo
2015-03-31 6:50 GMT-03:00 Jupiter Jones <[hidden email]>:
>
> To reply to my own question, this is how I’m doing it now, but would appreciate any advice from someone with more nginx experience.
>

This is how I'd do it:

upstream seaside {
     server 127.0.0.1:8383;
}

server {
 listen 80;
 server_name www.site2.com;
 root /dev/null;

  location /Site1App {
    proxy_pass http://seaside;
    proxy_set_header Authorization $http_authorization;
    proxy_pass_header Authorization;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
  }
}


Regards

Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside