Configure Apache server dns with nginx container

Solution for Configure Apache server dns with nginx container
is Given Below:

I created a webapp with 3 containers. Nginx, postgresql and php.
In every computer I tested it, it worked without problems.
In docker-compose I mapped the port 8082 to 80.

I had to put it in the “real” server and they needed to map the localhost:8082 of the server, where the webapp is running to a real address.

The problem is that the page seems to load the views but it doesn’t load the js and css
On the console, if i go to, I can see that it cannot load “http: // localhost:8082/output/final.js”.
But if, in the browser, I write “http: //”, I can see the js file

I really don’t know how Apache or Nginx server work. It seems it is not transforming the localhost:8082 to the

They prepared, inside the sites-available of /etc/apache2 of the server:

<VirtualHost *:80>

  ProxyPass / http://localhost:8082/
  #ProxyPassReverse / http://localhost:8082/

The docker-compose is configured as:

  image: nginx:stable-alpine
  container_name: nginx
   - "8082:80"
   - ./src:/var/www/html
   - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
   - php
   - database

and the default.conf of the nginx container is this:

server {
    listen 80;
    index index.php index.html;
    server_name localhost;
    error_log /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/html/public;

    location / {
            try_files $uri $uri/ /index.php?$query_string;

    location ~ .php$ {
            try_files $uri = 404;
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            fastcgi_pass php:9000;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;

Is there a way i can tell the Apache server to always transform localhost:8082 to