(have posted previously in general developer forums and realized after receiving no replies that my question is probably very specific to Nginx scripting: hopefully this forum is the right venue?)
I am trying to write a Nginx script for an Azure App Service WordPress site.
wp-content resources (for example, a web app launched by an HTM file) are stored at an Azure App Service backbone (backend) endpoint with a URL and path different from the primary site's URL and path.
Nginx script's goal is to test for a match for the web app's startup HTM file on the backbone endpoint server and, if matched, redirect the user to, for example in this test, www.google.com.
If I can get the test script working, I could add additional parameters like matching for a WordPress user signed-in cookie or WordPress Simple Membership signed-in cookie, to assure that only signed-in users or members can access and view the web app.
I am a beginner learning and using Nginx scripts. Have followed this technical link (https://techcommunity.microsoft.com/t5/apps-on-azure-blog/updating-nginx-default-configurations-on-azure-app-services/ba-p/3710146) to set up the basics using the Azure App Service's SSH terminal, assure the script plus additions persists using the /home directory and a startup.sh command pointing, at server restart, to the /home/default.conf script, reloading Nginx (nginx -s reload).
So far, tried several scripts with no joy. Latest (added to server block) which didn't work:
location ~ \.htm? {
proxy_pass https://xxxxxxxxxxxxxxx-endpoint.azureedge.net;
{return 301
$scheme://www.google.com$request_uri;}
}
I suspect that I am doing something wrong. Would appreciate any help. Thank you in advance.