Score:0

How can I write an Nginx rewrite from the IIS URL rewrite?

er flag

I have set up React + Flask app on windows IIS it is working fine. Now I want to use Nginx instead of IIS. I have created URL Rewrite in IIS from fronted to backend waitress server API calls.

photo for reference .

What will be the syntax for creating the same entry on Nginx Rewrite?

Following is nginx current config, I tried but got a network error during login.

Error Reference Error Reference 2

Following are details of the server and port:-

  • Machine:- Windows
  • Frontend :- http://localhost (Nginx)
  • Backend:- http://localhost:5000 (Waitress)
server {
    listen 0.0.0.0:80 default;
    server_name localhost;
    error_log c:/nginx/logs/front_end.log;
    access_log c:/nginx/logs/front_end_access.log;
    root D:/Simsight/frontend/dist/apps/simsight;
    index index.html index.htm;
    try_files $uri /index.html;
    location / {
        try_files $uri $uri/ = 404;
   # if ($request_uri !~ "/api(.*)$"){
    #    rewrite ^/api http://localhost:84/api/$1 redirect;
    #}
    }
    location /api {
        rewrite api(.*)$ http://localhost:5000$request_uri last;
    }
        #rewrite /api(.*)$ http://localhost:5000/api$1 last;
    
}
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.