[Seaside] nginx virtual hosting and seaside
Jupiter Jones
jupiter.jones at mail.com
Tue Mar 31 09:50:46 UTC 2015
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 <jupiter.jones at mail.com> 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:
> www.site1.com <http://www.site1.com/>
> www.site2.com <http://www.site2.com/>
> etc.
>
> and multiple applications running in seaside:
> www.site1.com/Site1App <http://www.site1.com/Site1App>
> www.site2.com/Site2App <http://www.site2.com/Site2App>
> 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 <http://www.site1.com/> serves the application at /Site1App
> www.site2.com <http://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 <http://site1.com/> www.site1.com <http://www.site1.com/>;
> root /dev/null;
> location / {
> proxy_pass http://seaside <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 <http://site1.com/> www.site2.com <http://www.site1.com/>;
> root /dev/null;
> location / {
> proxy_pass http://seaside <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
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150331/2d3d5b72/attachment.htm
More information about the seaside
mailing list