Could you please help me to figure out the following redirection using Nginx?
When a user type http(s)://(www.)domainA.com/view.php he/she will be able to access this view.php file (which is in web root)
All other requests which are coming to http(s)://(www.)domainA.com should be redirected to https://learn.domainB.com
(Basically no redirection should be happened only for this view.php file)
My current Nginx vhost file:
server { listen 80; server_name domainA.com www.domainA.com; root /var/www/public_html; if ($request_uri !~* (/view.php) ) { rewrite ^ https://learn.domainB.com permanent; } location /view\.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index view.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } I really appreciate your inputs. Thanks!