I have an application that returns POSTS from the payment system, but we currently force SSL to our site, I made the HTTP redirection to HTTPS, but I get a 404 error when the POSTBACK system sends the POST to the URL http://// ...., when my server tries to redirect to HTTPS (or does not try) the 404 error appears.
NGNIX File:
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/magicaonline.com.br/before/*;
server {
listen 80;
listen [::]:80;
return 307 https://magicaonline.com.br/$1;
}
server {
listen 443 http2;
listen [::]:443 http2;
server_name .magicaonline.com.br;
root /home/forge/magicaonline.com.br/public;
if ($host = 'www.magicaonline.com.br') {
rewrite ^/(.*)$ https://magicaonline.com.br/$1 permanent;
}
#if ($scheme = http) {
# return 302 https://$server_name$request_uri;
#}
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/magicaonline.com.br/132754/server.crt;
ssl_certificate_key /etc/nginx/ssl/magicaonline.com.br/132754/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'xxxxx';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;
index index.html index.htm index.php;
charset utf-8;
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/magicaonline.com.br/server/*;
location /lp/ {
try_files $uri $uri/ @wordpress;
}
location @wordpress {
rewrite /lp/ /lp/index.php;
}
location ^/lp/index.php(/.*)?$ {
fastcgi_split_path_info ^(/lp/index.php)(/.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/magicaonline.com.br-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/magicaonline.com.br/after/*;
Are there any possibilities to make this happen?
I need this solution because the payment system does not accept to modify the POSTBACK URL.