nginx proxy_pass仅适用于根path

我想将nginx设置为apache的反向代理。 我在端口8080上有apache。它只适用于根path,例如https://www.example.com ,但它不适用于https://www.example.com/index.html

location / { try_files $uri $uri/ /index.php; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; } 

我尝试join斜线地址,如http://127.0.0.1:8080/,但后来我得到configuration错误。 就像这里: https : //stackoverflow.com/questions/21662940/nginx-proxy-pass-cannot-have-uri-part-in-location我试图使用重写,但我不知道该重写什么是。