There is a dev server on Apache, everything works well, but Nginx is installed on the production server and there are problems with it. You need to send a post ajax request to the server to the index.php file located in the TEST folder. The ajax request URL looks like this / TEST / checkout / confirm additional parameters are also passed. On the server, we accept the request and process
$app->post('/checkout/confirm', function () use ($app) { .... }
How to configure Nginx cofig so that it correctly sends the post request?
.htaccess from folder TEST
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L]
Nginx configuration
server { listen 80; server_name easypay.bigbar.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name easypay.bigbar.com www.easypay.bigbar.com; root /var/www/easypay.bigbar.com; index index.php; location / { try_files $uri $uri/ /index.php ; rewrite ^/fb https://facebook.com/bigbardogbeds last; rewrite ^/freereturns /free-return.php last; rewrite ^/return-policy /return-policy2.php last; rewrite ^/orderconfirmation /orderconfirmation.php last; rewrite ^/pages/([^/]+)/?$ /$1.php last; rewrite ^/pages/return-policy /return-policy2.php last; rewrite ^/collections/(accessories)$ /$1.php last; rewrite ^/collections/accessories/products/([^/]+)/?$ /$1.php last; rewrite ^/products/([^/]+)/?$ /$1.php last; } location /TEST { alias /var/www/easypay.bigbar.com/TEST; # index index.php; # try_files $uri $uri/ /index.php; # try_files $uri $uri/ /index.php$request; # autoindex on; include fastcgi_params; try_files $uri $uri/ /TEST/index.php?$args; # To allow POST on static pages #rewrite ^/TEST /index.php last; } ssl on; ssl_certificate /etc/nginx/ssl/easypay/easypay.crt; ssl_certificate_key /etc/nginx/ssl/easypay/easypay.key; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; } location ~* \.(jpg|jpeg|png|gif|ico)$ { expires 365d; log_not_found off; access_log off; } location ~ \.php(.*)$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm-easypay.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # ssl on; }
server
to the question. You can correct the question by clicking edit . - aleksandr barakin