Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Redirect everything to HTTPS except one URL

$
0
0
Hi,

I have an ecommerce website where I redirect everything to HTTPS, but there is a payment method that can't POST to https, so transactions status never change automatically.
I need to exclude the return URL of this payment method from HTTPS and receive on HTTP.

So far what I did:

(port 80)

location / { return 301 https://$host$request_uri;
}
location /wc-api/ {}

##########

(port 443)

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

location /wc-api/~* { return 301 http://$host$request_uri; }

###########

Return URL is https://mystore.com/wc-api/WC_PagSeguro_Gateway/

Everything works fine without SSL,

Thanks in advance

Nicolas

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>