Rumah  >  Soal Jawab  >  teks badan

Bagaimanakah proksi terbalik nginx url relatif?

server {
    listen       80;
    server_name  www.hehehe.com;

    charset utf-8;
    
    location /test {
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:3031;
    }
}

Untuk permintaan seperti ini di http://hehehe.com/test/index
Proksi terbalik mencapai uwsgi iaitu aplikasi Django

Kemudian saya hanya mahu proksi bahagian /index dari respons url, bukan /test/index

Sekarang /test/index menyebabkan laluan url django saya gagal dipadankan.

大家讲道理大家讲道理2713 hari yang lalu476

membalas semua(1)saya akan balas

  • PHP中文网

    PHP中文网2017-05-16 17:17:51

    server {
        listen 80 default_server;
        client_max_body_size   10M;
        client_body_buffer_size   128k;
    
        server_name $host;
    
        index index.html;
        root /website/$host;
        location / {
        }
        location ~ /dev/ {
            rewrite /dev/(.*)$ / break;
            proxy_pass http://localhost:3000;
        }
    }

    Tulis semula

    balas
    0
  • Batalbalas