Ecommerce Shopify WordPress Discussion

Redirects problems in wordpress behind nginx proxy

Docker-compose wordpress (I am using https://hub.docker.com/_/wordpress this image): version: '3.8' services: asd-wordpress: image: ${DOCKER_REGISTRY}/asd/asd-wordpress:latest environment: - WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST} - WORDPRESS_DB_USER=${WORDPRESS_DB_USER} - WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD} - WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME} - WORDPRESS_CONFIG_EXTRA= define( 'WP_HOME', 'http://asd.com/wp-site' ); define( 'WP_SITEURL', 'http://asd.com/wp-site' ); ports: - "8080:80" networks: - mynet volumes: - wordpress:/var/www/html restart: always extra_hosts: - "db-srv:$HOST_DB" networks: mynet: volumes: wordpress: Nginx config: location ^~ /wp-site/ { include conf.d/common/maintenance_conditions.conf; #request headers proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Server $host; proxy_pass http://wp_upstream/; proxy_no_cache 1; } location ~ /\.ht { # Deny access to .htaccess, .htpassword deny all; } What works fine: http://asd.com/wp-site/ -> opens a website http://asd.com/wp-site/wp-admin -> opens login page after redirecting to http://asd.com/wp-site/wp-login.php?redirect_to=http%3A%2F%2Fwp_upstream%2Fwp-admin%2F&reauth=1 -> after logging in it redirects to correct http://asd.com/wp-site/wp-admin/ page I can open every page on wordpress. What does not work properly: http://asd.com/wp-site/wp-admin/options-general.php - opens just fine, but if I try to submit "Save changes" button it redirects to wrong page http://asd.com/wp-admin/options-general.php?settings-updated=true (no /wp-site/ in url). If I add /wp-site/ to url manually settings are saved correctly and I am redirected to correct page again. My wordpress structure: #/var/www/html/ total 252K drwxr-xr-x. 6 33 tape 80 Jan 17 19:27 wp-content drwxr-xr-x. 5 33 tape 4.0K Jan 17 19:13 . -rw-r--r--. 1 33 tape 539 Jan 17 19:10 .htaccess -rw-r--r--. 1 33 tape 5.5K Jan 17 19:09 wp-config.php drwx-----x. 3 root root 19 Jan 17 19:09 .. -rw-r--r--. 1 33 tape 5.4K Jan 12 01:26 wp-config-docker.php drwxr-xr-x. 27 33 tape 12K Dec 6 17:25 wp-includes drwxr-xr-x. 9 33 tape 4.0K Dec 6 17:25 wp-admin -rw-r--r--. 1 33 tape 3.0K Nov 15 18:47 wp-config-sample.php -rw-r--r--. 1 33 tape 26K Oct 10 16:05 wp-settings.php -rw-r--r--. 1 33 tape 3.1K Sep 30 09:39 xmlrpc.php -rw-r--r--. 1 33 tape 50K Sep 30 00:01 wp-login.php -rw-r--r--. 1 33 tape 8.4K Sep 16 08:50 wp-mail.php -rw-r--r--. 1 33 tape 3.9K Jul 16 2023 wp-load.php -rw-r--r--. 1 33 tape 7.3K Jul 5 2023 readme.html -rw-r--r--. 1 33 tape 4.8K Jun 22 2023 wp-trackback.php -rw-r--r--. 1 33 tape 34K Jun 19 2023 wp-signup.php -rw-r--r--. 1 33 tape 2.3K Jun 14 2023 wp-comments-post.php -rw-r--r--. 1 33 tape 5.6K May 30 2023 wp-cron.php -rw-r--r--. 1 33 tape 7.1K May 12 2023 wp-activate.php -rw-r--r--. 1 33 tape 20K Jan 1 2023 license.txt -rw-r--r--. 1 33 tape 2.5K Nov 26 2022 wp-links-opml.php -rw-r--r--. 1 33 tape 405 Feb 6 2020 index.php -rw-r--r--. 1 33 tape 351 Feb 6 2020 wp-blog-header.php My .htaccess: # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase /wp-site/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp-site/index.php [L] </IfModule> # END WordPress There is also problem with different endpoints like http://asd.com/wp-site/graphql -> it does not work (500 Internal error with error: AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.) but http://asd.com/wp-site/?graphql=true works fine.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.