nginx 反向代理 及特定路径跳转

server {
    listen 80;
    listen [::]:80;
    server_name XX.XX.XXXX.com;


    # set max upload size
    client_max_body_size 512M;


    #access_log /var/log/nginx/XXXX.access.log main;
    location = / {
rewrite ^ /path/index1.php permanent;
    }

    location / {
  
rewrite /path/index.php  /path/index1.php break;
proxy_pass https://XX.XX.XX.XX:446;
        proxy_redirect     default;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
}

你可能感兴趣的:(linux)