<p>I have default nginx file which I am copying on /etc/nginx/sites-available/ location, when I do certain changes in default file the changes are not getting reflected in that file under pod.</p>
<p>I have mentioned the copy command to copy default file under /etc/nginx/sites-available/, wanted to know if this default file is being auto generated by nginx as a result not able to reflect my changes. Is there any way to change default file?</p>
<p>I tried by directly changing the default file inside pod but once pod gets restart changes will be lost.</p>
<p>default file</p>
<pre><code>##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
        #Sample testing to the file
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:8000
    #
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
    #
        # With php5-cgi alone:
    #   fastcgi_pass 127.0.0.1:9000;
    #   # With php5-fpm:
        fastcgi_pass unix:/var/run/php5-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen [::]:80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}
</code></pre>
<p>Dockerfile</p>
<pre><code>FROM node:12.10.0

ENV APP_ROOT /usr/src/webapp/
ENV DOC_ROOT /var/www/html/

ENV DEV_ENV development
ENV DEV_BASE_HREF https://app.com/app-development/

RUN mkdir -p $APP_ROOT $DOC_ROOT
RUN chmod 777 $DOC_ROOT

COPY . $APP_ROOT

RUN chmod 777 init.sh

RUN apt-get update \
    &amp;&amp; apt-get install nginx -y

RUN npm cache clean --force \
    &amp;&amp; npm rebuild node-sass \
    &amp;&amp; npm install -g @angular/cli@v1.6.5 --unsafe

RUN rm -rf /etc/nginx/sites-available/default

COPY default /etc/nginx/sites-available/default

RUN ls /etc/nginx/sites-available &amp;&amp; cat /etc/nginx/sites-available/default



RUN npm cache clear --force &amp;&amp; npm install --no-shrinkwrap --update-binary


RUN node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod --env=prod -extract-css false --base-href $DEV_BASE_HREF --output-path=./dist 

EXPOSE 80
ENTRYPOINT [&quot;/bin/bash&quot;, &quot;init.sh&quot;]
CMD [&quot;dev&quot;]

</code></pre>

<p>Not sure why you are using the Nginx and Node both in single Dockerfile</p>
<p>ideally, you should be running the single process inside the container.</p>
<pre><code>COPY ./nginx/default.conf /etc/nginx/nginx.conf 
</code></pre>
<p>You can overwrite the file inside the Dockerfile like above.</p>
<pre><code>COPY default /etc/nginx/sites-available/default
</code></pre>
<p>Make sure your file is getting removed or else you can run the remove command</p>
<pre><code>RUN ls /etc/nginx/sites-available &amp;&amp; cat /etc/nginx/sites-available/default
</code></pre>
<p>verify actually your file getting placed into <strong>docker</strong></p>
<pre><code>RUN npm cache clean --force \
    &amp;&amp; npm rebuild node-sass \
    &amp;&amp; npm install -g @angular/cli@v1.6.5 --unsafe

RUN rm /etc/nginx/sites-available/default

COPY default /etc/nginx/sites-available/

RUN ls /etc/nginx/sites-available &amp;&amp; cat /etc/nginx/sites-available/default


RUN npm cache clear --force &amp;&amp; npm install --no-shrinkwrap --update-binary
</code></pre>
