Heim  >  Fragen und Antworten  >  Hauptteil

Problem mit der Nginx-Dateiumleitung

Die ursprüngliche Adresse lautet http://aaa.com/aaa.swf

Die neue Adresse lautet http://bbb.com/bbb (kein .swf, das Programm lädt es automatisch)

Wie können wir in diesem Fall beim Zugriff auf die Quelladresse das automatische Laden neuer Adressen (keine Sprünge) erreichen?

怪我咯怪我咯2712 Tage vor674

Antworte allen(2)Ich werde antworten

  • 滿天的星座

    滿天的星座2017-05-16 17:30:42

    location ~ ^/aaa.swf {
        root /var/www/bbb.com # the local file path of bbb
        # use rewrite to map aaa.swf to bbb
    }
    

    Antwort
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 17:30:42

    如果不在同一台主机上,可以通过反向代理来实现

    bbb.comserver {}块中加入如下语句即可。

    location / { 
        if ($uri = /bbb)
        {   
            rewrite ^/bbb$ /aaa.swf break;
            proxy_pass http://aaa.com;
        }   
    }   
    

    Antwort
    0
  • StornierenAntwort