Magento 2 install to subfolder problem












0















I am installing Magento 2 into a subdirectory beside the main installation. I would like to configure the subdirectory named "test". However, when I try to access localhost/test to enter the setup page, it just tells:




localhost redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.




Here is my NGINX config :



server {
listen 80 reuseport;
server_name localhost;

access_log /var/log/nginx/access.log ;
error_log /var/log/nginx/error.log ;

set $MAGE_ROOT /var/www/magento2;
root $MAGE_ROOT/pub;

## Magento Setup Tool
include conf_m2/setup.conf;

# Deny all internal locations also default phpmyadmin
location ~ ^/(app|bin|var|tmp|phpserver|vendor|magento_version|php[mM]y[aA]dmin|pma)/? { deny all; }

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

## Static location
include conf_m2/assets.conf;

location @static { rewrite /static/(versiond*/)?(.*)$ /static.php?resource=$2 last; }
location @media { try_files $uri $uri/ /get.php$is_args$args; }

## Process php files (strict rule, define files to be executed)
location ~ (index|health_check|get|static|report|404|503).php$ {
try_files $uri =404;

include conf_m2/php_backend.conf;
fastcgi_cache microcache;
fastcgi_cache_key $scheme|$host|search|$arg_q;
fastcgi_cache_valid 200 301 302 2h;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
}

###Here is the directory I want to installed another magento 2, but it now works
rewrite ^/test /test/$1 permanent;
location /test {
try_files $uri /$uri/index.php?$args;
index index.php index.html index.htm;
}
rewrite ^/test/admin /test/admin/$1 permanent;
}









share|improve this question
















bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • how did u resolve this ?

    – Sarasranglt
    Jan 28 at 19:33
















0















I am installing Magento 2 into a subdirectory beside the main installation. I would like to configure the subdirectory named "test". However, when I try to access localhost/test to enter the setup page, it just tells:




localhost redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.




Here is my NGINX config :



server {
listen 80 reuseport;
server_name localhost;

access_log /var/log/nginx/access.log ;
error_log /var/log/nginx/error.log ;

set $MAGE_ROOT /var/www/magento2;
root $MAGE_ROOT/pub;

## Magento Setup Tool
include conf_m2/setup.conf;

# Deny all internal locations also default phpmyadmin
location ~ ^/(app|bin|var|tmp|phpserver|vendor|magento_version|php[mM]y[aA]dmin|pma)/? { deny all; }

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

## Static location
include conf_m2/assets.conf;

location @static { rewrite /static/(versiond*/)?(.*)$ /static.php?resource=$2 last; }
location @media { try_files $uri $uri/ /get.php$is_args$args; }

## Process php files (strict rule, define files to be executed)
location ~ (index|health_check|get|static|report|404|503).php$ {
try_files $uri =404;

include conf_m2/php_backend.conf;
fastcgi_cache microcache;
fastcgi_cache_key $scheme|$host|search|$arg_q;
fastcgi_cache_valid 200 301 302 2h;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
}

###Here is the directory I want to installed another magento 2, but it now works
rewrite ^/test /test/$1 permanent;
location /test {
try_files $uri /$uri/index.php?$args;
index index.php index.html index.htm;
}
rewrite ^/test/admin /test/admin/$1 permanent;
}









share|improve this question
















bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • how did u resolve this ?

    – Sarasranglt
    Jan 28 at 19:33














0












0








0


1






I am installing Magento 2 into a subdirectory beside the main installation. I would like to configure the subdirectory named "test". However, when I try to access localhost/test to enter the setup page, it just tells:




localhost redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.




Here is my NGINX config :



server {
listen 80 reuseport;
server_name localhost;

access_log /var/log/nginx/access.log ;
error_log /var/log/nginx/error.log ;

set $MAGE_ROOT /var/www/magento2;
root $MAGE_ROOT/pub;

## Magento Setup Tool
include conf_m2/setup.conf;

# Deny all internal locations also default phpmyadmin
location ~ ^/(app|bin|var|tmp|phpserver|vendor|magento_version|php[mM]y[aA]dmin|pma)/? { deny all; }

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

## Static location
include conf_m2/assets.conf;

location @static { rewrite /static/(versiond*/)?(.*)$ /static.php?resource=$2 last; }
location @media { try_files $uri $uri/ /get.php$is_args$args; }

## Process php files (strict rule, define files to be executed)
location ~ (index|health_check|get|static|report|404|503).php$ {
try_files $uri =404;

include conf_m2/php_backend.conf;
fastcgi_cache microcache;
fastcgi_cache_key $scheme|$host|search|$arg_q;
fastcgi_cache_valid 200 301 302 2h;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
}

###Here is the directory I want to installed another magento 2, but it now works
rewrite ^/test /test/$1 permanent;
location /test {
try_files $uri /$uri/index.php?$args;
index index.php index.html index.htm;
}
rewrite ^/test/admin /test/admin/$1 permanent;
}









share|improve this question
















I am installing Magento 2 into a subdirectory beside the main installation. I would like to configure the subdirectory named "test". However, when I try to access localhost/test to enter the setup page, it just tells:




localhost redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.




Here is my NGINX config :



server {
listen 80 reuseport;
server_name localhost;

access_log /var/log/nginx/access.log ;
error_log /var/log/nginx/error.log ;

set $MAGE_ROOT /var/www/magento2;
root $MAGE_ROOT/pub;

## Magento Setup Tool
include conf_m2/setup.conf;

# Deny all internal locations also default phpmyadmin
location ~ ^/(app|bin|var|tmp|phpserver|vendor|magento_version|php[mM]y[aA]dmin|pma)/? { deny all; }

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

## Static location
include conf_m2/assets.conf;

location @static { rewrite /static/(versiond*/)?(.*)$ /static.php?resource=$2 last; }
location @media { try_files $uri $uri/ /get.php$is_args$args; }

## Process php files (strict rule, define files to be executed)
location ~ (index|health_check|get|static|report|404|503).php$ {
try_files $uri =404;

include conf_m2/php_backend.conf;
fastcgi_cache microcache;
fastcgi_cache_key $scheme|$host|search|$arg_q;
fastcgi_cache_valid 200 301 302 2h;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
}

###Here is the directory I want to installed another magento 2, but it now works
rewrite ^/test /test/$1 permanent;
location /test {
try_files $uri /$uri/index.php?$args;
index index.php index.html index.htm;
}
rewrite ^/test/admin /test/admin/$1 permanent;
}






magento2 installation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 '18 at 7:57









Nisse Engström

42355




42355










asked Jan 1 '18 at 6:50









want_to_be_calmwant_to_be_calm

101




101





bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • how did u resolve this ?

    – Sarasranglt
    Jan 28 at 19:33



















  • how did u resolve this ?

    – Sarasranglt
    Jan 28 at 19:33

















how did u resolve this ?

– Sarasranglt
Jan 28 at 19:33





how did u resolve this ?

– Sarasranglt
Jan 28 at 19:33










1 Answer
1






active

oldest

votes


















0














I'm no nginx expert but this
rewrite ^/test /test/$1 permanent;
suspiciously looks like an endless loop.



Why are you doing this? Just create a subdirectory in /var/www/ like /var/www/test and install Magento there.






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f207671%2fmagento-2-install-to-subfolder-problem%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I'm no nginx expert but this
    rewrite ^/test /test/$1 permanent;
    suspiciously looks like an endless loop.



    Why are you doing this? Just create a subdirectory in /var/www/ like /var/www/test and install Magento there.






    share|improve this answer






























      0














      I'm no nginx expert but this
      rewrite ^/test /test/$1 permanent;
      suspiciously looks like an endless loop.



      Why are you doing this? Just create a subdirectory in /var/www/ like /var/www/test and install Magento there.






      share|improve this answer




























        0












        0








        0







        I'm no nginx expert but this
        rewrite ^/test /test/$1 permanent;
        suspiciously looks like an endless loop.



        Why are you doing this? Just create a subdirectory in /var/www/ like /var/www/test and install Magento there.






        share|improve this answer















        I'm no nginx expert but this
        rewrite ^/test /test/$1 permanent;
        suspiciously looks like an endless loop.



        Why are you doing this? Just create a subdirectory in /var/www/ like /var/www/test and install Magento there.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 3 '18 at 9:21

























        answered Jan 3 '18 at 9:15









        sterossteros

        827629




        827629






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f207671%2fmagento-2-install-to-subfolder-problem%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What other Star Trek series did the main TNG cast show up in?

            Berlina muro

            Berlina aerponto