Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sylius won't run in subdirectory of domain "The page you are looking for does not exist." #520

Open
AmtechInnovarch opened this issue Feb 26, 2021 · 0 comments

Comments

@AmtechInnovarch
Copy link

I have installed Sylius into a subdirectory of a domain and set location /store in the nginx block. I get Sylius loading "The page you are looking for does not exist."

Error "The page you are looking for does not exist." occurs from this:

server {
    server_name domain.com www.domain.com;
    root /var/www/domain.com;

    index index.html index.htm index.php;

    location / {
        try_files $uri $uri/ =404;
        if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php?q=$1 last;
        }
    }

    location /store{
        root /var/www/domain.com/sylius/public;
        index index.php;
        try_files $uri /index.php$is_args$args;
    }
        location ~ ^/store/index\.php(/|$) {
            fastcgi_pass unix:/run/php/php7.4-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
            #internal;
        }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
     }

    location ~ /\.ht {
        deny all;
    }

}

When I make a new nginx block using location / and the server_name at a subdomain store.domain.com I can get Sylius to work properly.

This does not make any errors (Sylius loads as expected when setting location /):

server {
    server_name store.domain.com www.store.domain.com;
    root /var/www/store.domain.com/sylius/public;

    index index.html index.htm index.php;

    location / {
        try_files $uri /index.php$is_args$args;
    }
        location ~ ^/index\.php(/|$) {
            fastcgi_pass unix:/run/php/php7.4-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
            #internal;
        }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
     }

    location ~ /\.ht {
        deny all;
    }

}

I already have CMS installed for my blog content and template. I need Sylius to load into iframe in my template for consistent looks. CORS prevents reading document object to resize iframe and strip Sylius footer in javascript.

Why does Sylius break when I change the nginx location to /store?

Is there a better way to inject Sylius into the CMS without writing a whole new front end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant