Nginx代理服务器通行证,并从URL中删除.php扩展名

我试图Proxy Pass /do/uploads.php?id=xxx Proxy Pass /do/upload?id=xxx在Nginx

这是我的尝试

 location /do { rewrite /do/uploads\.php /do/uploads$1 break; proxy_pass http://domain/do; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; } 

我find了解决scheme。 这里是:

 location = /do/uploads.php { proxy_pass http://domain/switch/do; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; }