Jump to:

1160 Posts in 2632 Topics by 409 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » having a little trouble migrating an old site to nginx...

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 620 Views
  • KlamathPort
    Avatar
    Community Member
    2 Posts

    having a little trouble migrating an old site to nginx... Link to this post

    hey guys, haven't been here (or used silverstripe) in a while... v3. is looking pretty snazzy!!

    Anyhoo, I was migrating a bunch of sites from an old apache server onto a new nginx one, and I'm having heaps of trouble with this silverstripe site...

    - Some assets are redirecting to https:// urls, so none of my styles are loading..
    - the site loads /really/ slowly.. like, it takes up to a minute. sometimes not loading at all
    - I can't seem to access the login page...

    I've open-sourced the whole project (incl db & nginx config) so if anyone can take a quick peek and maybe point me in the right direction I'd be very appreciative!!

    Thanks,
    Dean.

    http://schoolandcommunitymusic.com.au
    https://github.com/deanrather/scm-website

  • yavosh
    Avatar
    Community Member
    1 Post

    Re: having a little trouble migrating an old site to nginx... Link to this post

    I had the same problem.

    I found that silverstripe checks the following to detect SSL
    (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')

    However in nginx HTTPS server header was set to empty string and not on as it is in apache.
    I did not have much time to research why nginx behaves this way and if it is more correct, but I ended up changing the above line to this

    (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')

    I had to change it in a few places
    /sapphire/core/HTTP.php
    /sapphire/core/control/Director.php
    /sapphire/main.php

    Hope this helps
    yavor

    620 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.