Custom Login URL On NGINX Server and Invalid Token

Permalink
Sorry if I'm posting in the wrong forum here - I honestly have no idea where I'd go to solve this issue.

I'm running a site with Concrete 5.7.5.9 on an NGINX server. We needed the /login url to redirect to a different site, so we threw:

location /login {
    rewrite ^/login$ https://website.com/$1 redirect;
}


in our NGINX configuration file which, great! works beautifully, redirects as it should!

We then:
- copied 'concrete/single_pages/login.php' to 'application/single_pages/cms_login.php'
- copied 'concrete/controllers/single_page/login.php' to 'application/controllers/single_page/cms_login.php' and
- created a new single page url (/cms_login) through '/index.php/dashboard/pages/single'

and cool! everything loads properly on /cms_login, looks the exact same, etc!

The problem comes when you submit the form - for *whatever* reason, on an NGINX server it keeps throwing an 'invalid token' error. The token is refreshing on each page load, and I copied the code over, so the form looks like this:

<div class="controls <?php if (count($activeAuths) < 2) { ?>col-sm-12<?php } else { ?>col-sm-8<?php } ?> col-xs-12">
    <?php
    if ($attribute_mode) {
        $attribute_helper = new Concrete\Core\Form\Service\Widget\Attribute();
        ?>
        <form action="<?php echo View::action('fill_attributes') ?>" method="POST">
            <div data-handle="required_attributes"
                class="authentication-type authentication-type-required-attributes">
                <div class="ccm-required-attribute-form"
                    style="height:340px;overflow:auto;margin-bottom:20px;">
                    <?php
                        foreach ($required_attributes as $key) {
                           echo $attribute_helper->display($key, true);
                        }
                    ?>


I'm honestly at a loss as to why, on an apache server the above code works beautifully, but on an NGINX server concrete throws an invalid error. But ONLY when the /location redirect code is in the NGINX configuration file - you take those three lines out, and suddenly the /cms_login page works beautifully!

Please help.

View Replies: