Nginx rewrite rule with proxy pass

后端 未结 2 1046
遇见更好的自我
遇见更好的自我 2020-12-24 12:59

I\'m trying to implement nginx rewrite rules for the following situation

Request:

http://192.168.64.76/Shep.ElicenseWeb/Public/OutputDocuments.ashx?u         


        
相关标签:
2条回答
  • 2020-12-24 13:55

    Your rewrite statement is wrong.

    The $1 on the right refers to a group (indicated by paratheses) in the matching section.

    Try:

    rewrite  ^/Shep.ElicenseWeb/(.*)  /$1 break;
    
    0 讨论(0)
  • 2020-12-24 14:03

    You're missing a trailing slash:

    location /Shep.ElicenseWeb/ {
        proxy_pass http://localhost:82/;
    }
    

    This will work without a rewrite.

    0 讨论(0)
提交回复
热议问题