Ask everyone a question about nginx reverse proxy.

problem description

A nginx reverse proxy with two different addresses of location agents, one is a static page proxy, and the other cannot be accessed after completion

the platform version of the problem and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

server {
    listen       8800;
    server_name  localhost;

    location /rms{
        root   html;
        index  index.html index.htm;
        add_header "Access-Control-Allow-Origin" "*";
        add_header Access-Control-Allow-Methods GET,POST,OPTIONS,DELETE;
        add_header "Access-Control-Allow-Headers" "userId,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type";
        proxy_pass http://9.1.8.249:8082/rms ;
    }
     location /rizhiyi/ {
        root   html;
       alias /;
        index  index.html index.htm;
        proxy_pass http://9.1.8.76/;
    }
    location ~* ^/(rizhiyi|images|img|javascript|js|css|blog|flash|media|static|api|auth|account|ico)/ {
        proxy_pass http://9.1.8.76:80;
   }

because the location / rizhiyi/ section has a static page, I want to add this location ~ * but add the location / rms section above this paragraph and I can"t access it.

what result do you expect? What is the error message actually seen?

I hope the master can help me. Hold the fist.

Jun.07,2022

location

add an alias /;

to your / rms.
Menu