反向代理的等效nginx命令

反向代理的等效nginx命令,nginx,Nginx,我正在尝试从apache for nginx转换以下配置: <LocationMatch "/"> ProxyPass http://127.0.0.1:8080/demo/ ProxyPassReverse http://127.0.0.1:8080/demo/ ProxyPassReverseCookiePath /demo </LocationMatch> <

我正在尝试从apache for nginx转换以下配置:

<LocationMatch "/">
        ProxyPass           http://127.0.0.1:8080/demo/
        ProxyPassReverse    http://127.0.0.1:8080/demo/
        ProxyPassReverseCookiePath /demo
    </LocationMatch>

<LocationMatch "/demo">
        ProxyPass           http://127.0.0.1:8080/demo/
        ProxyPassReverse    http://127.0.0.1:8080/demo/
        ProxyPassReverseCookiePath /demo
    </LocationMatch>
location / {
        #try_files $uri $uri/ =404;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_max_temp_file_size 0;
        proxy_pass http://tomcat/micropbx/;
        proxy_read_timeout 300;
}

location /micropbx {
        #try_files $uri $uri/ =404;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_max_temp_file_size 0;
        proxy_pass http://tomcat/micropbx/;
        proxy_read_timeout 300;
}