We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53190
    • 2 Posts
    Hello,

    I installed the newset version of Revo in a subdirectory called "modx".
    I use the following configuration on the NginX instance, which is serving the pages behind the proxy:

    server {
        listen 83;
        server_name localhost 127.0.0.1;
        root /path/to/www;
        index index.php index.html;
    
        location / {
            #try to get file directly, try it as a directory or fall back to modx
            try_files $uri $uri/ @modx;
        }
    
        location @modx {
            #including ? in second rewrite argument causes nginx to drop GET params, so append them again
            rewrite ^/(.*)$ /index.php?q=$1&$args;
        }
    
        location ~ \.php(.*)$ {
            include fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
    }
    


    Everytime I call a URL like "www.exmaple.com/modx/", "www.exmaple.com/modx/index.php", "www.exmaple.com/modx/manager/" or "www.exmaple.com/modx/manager/index.php" I get a 404.
    This is the header of the 404 I get with "curl -I <URL>":

    HTTP/1.1 404 Not Found
    Server: nginx
    Date: Mon, 27 Feb 2017 21:56:22 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: PHPSESSID=norve8v6mvuckrfkll2o5q6sc4; expires=Mon, 06-Mar-2017 21:56:22 GMT; Max-Age=604800; path=/modx/; HttpOnly
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate
    Pragma: no-cache
    X-Powered-By: MODX Revolution
    


    It seems like MODX serves this page, but I cannot find out why I get this 404. I tried since 2 weeks different "solutions" and all possible workarounds I could find but nothing worked.
    Do you have any suggestions?

    Regards,
    Jens
      • 3749
      • 24,544 Posts
      I know next to nothing about nginx, but I'm pretty sure your root needs to be a URL, not a path -- e.g., web/subdirectory/www;
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting