Reverse proxy Nginx to Apache

On one day I was baffled by the previous become Backend apache web server, then an error occurs on the java code as the gateway of the Nginx web server,

that where apache and nginx is located on a different port,

therefore I added the following scheme, assuming that the server nginx forward the packet to the Apache web server:

location / {
   ......
   proxy_set_header X-Forwarded-Host $host;
   proxy_set_header X-Forwarded-Server $host;
   proxy_set_header X-Forwarded-For 
   proxy_pass http://127.0.0.1:8081/; #apache port
   ......
}

Then reload or restart the service Nginx

service nginx restart