Viewing 8 replies - 1 through 8 (of 8 total)
  • Anonymous User 14742457

    (@anonymized-14742457)

    Hello jrybacek,

    Did you manage to fix it?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Almost always NGINX config related. Rules are here https://codex.wordpress.org/Nginx

    Thread Starter jrybacek

    (@jrybacek)

    I believe that it is NGINX related, however I haven’t been good enough to figure out how to resolve the issue.

    I’ve followed that guide and a few others, but I haven’t had any luck.

    My next steps are to clone the box and swap NGINX to Apache, or rebuild the Linux server with stock NGINX, Woocommerce and WordPress and see if the issue still exists.

    Thread Starter jrybacek

    (@jrybacek)

    What would be helpful is to figure out if there is a way to debug what is being passed to the PHP engine. That way I have another step to determine if my NGINX config is actually correct.

    Mike, any ideas on how to do that?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    If you have a cart and cannot get https://www.rightbrainboutique.com/checkout/?wc-ajax=checkout to show JSON, your querystring is likely ignored.

    Remember NGINX has separate config for your HTTPS server.

    Thread Starter jrybacek

    (@jrybacek)

    Darn, I thought you might have been onto something there.

    Based on hitting this URL “https://www.rightbrainboutique.com/checkout/?wc-ajax=checkout” and the configuration below (i just cut out a small section)…

    server {
    listen 443 ssl;

    location / {
    try_files $uri $uri/ /index.php?q=$request_uri;
    }
    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    include fastcgi.conf;
    }
    }

    I now realize those locations statements are probably in the wrong order, so I changed it to this, however it still doesn’t work. Its like PHP isn’t getting the URL parameters passed to it.

    server {
    listen 443 ssl;

    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    include fastcgi.conf;
    }
    location / {
    try_files $uri $uri/ /index.php?q=$request_uri;
    }
    }

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Maybe your host can assist? I can only go by https://codex.wordpress.org/Nginx – I’m by no means a server expert 🙂

    Anonymous User 14742457

    (@anonymized-14742457)

    My server is Nginx on Ubuntu, I managed to get it to work. Here is my config. All requests are redirected to 443 SSL

    server {
    	listen 80;
    	server_name example.com;
    	# redirect all requests automatically to SSL
    	rewrite ^/(.*) https://example.com/$1 permanent;
    }
    
    # Redirect www to non-www
    server {
        server_name www.example.com;
        return 301 $scheme://example.com$request_uri;
    }
    
    # Launch wordpress
    server {
    	listen 443 ssl;
    	root /home/example/Public/wordpress;
    	server_name example.com;
    
    	include /etc/nginx/sites-available/includes/letsencrypt;
    
    	include /etc/nginx/sites-available/includes/php-configuration;
    
            # Add index.php to the list if you are using PHP
    	index index.php index.html index.htm index.nginx-debian.html;
    
    	# increase file size limit for PHP and WordPress uploads
    	client_max_body_size 50M;
    
    	location / {
    		# First attempt to serve request as file, then
    		# as directory, then fall back to displaying a 404.
    		#try_files $uri $uri/ =404;
            	try_files $uri $uri/ /index.php?$args;
    	}
    
    }

    And php-configuration file:

    location ~ \.php$ {
    	try_files $uri =404;
           	fastcgi_split_path_info ^(.+\.php)(/.+)$;
           	fastcgi_pass unix:/var/run/php5-fpm.sock;
           	fastcgi_index index.php;
           	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           	include fastcgi_params;
    }

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Checkout page only works if WordPress permalinks are set to default’ is closed to new replies.