Konfigurieren Nginx mit proxy_pass

Ich versuche zu konfigurieren Nginx proxy Zeug auf einer subdomain: dev.int.com

Ich will dev.int.com werden Proxy-IP:8080 ein, und dev.int.com/stash werden Proxy-IP:7990

Hier ist meine aktuelle config-Datei

server {
listen   80;
server_name  dev.int.com;
access_log off;
location /{
    proxy_pass http://IP:8080;
    proxy_set_header    Host            $host;
    proxy_set_header    X-Real-IP       $remote_addr;
    proxy_set_header    X-Forwarded-for $remote_addr;
    port_in_redirect off;
    proxy_redirect   http://IP:8080/jira  /;
    proxy_connect_timeout 300;
    location ~ ^/stash {
        proxy_pass http://IP:7990;
        proxy_set_header    Host            $host;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-for $remote_addr;
        port_in_redirect off;
        proxy_redirect   http://IP:7990/ /stash;
        proxy_connect_timeout 300;
    }
}

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
    root   /usr/local/nginx/html;
    }
}

Jedoch /stash Umleitungen von /. Was mache ich falsch?

InformationsquelleAutor bear | 2012-10-11
Schreibe einen Kommentar