Score:0

Nginx wordpress proxy pass

tr flag

after hours of trying and google i thought my last chance to get it solved is here.

i have the following problem:

  • A Wordpress page is running under myperfectshop.com
  • The shop just have one product at the moment, which is located under myperfectshop.com/product/first
  • Till there are further products i want that everyone will get redirected from the URL "/" to "/product/first"
  • This should happen with a proxy pass, so that the URL will remain "/"

i have tried the following code:

...
        location = / {
                proxy_pass https://myperfectshop.com/product/first
        }
        
        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass wordpress:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
        }

...

But this example will end up in an infinity loop for the root path. all other paths are working fine.

Can somebody please explaine me what i am doing wrong?

Thanks in advance.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.