<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">I have setup this node app in my K8s cluster:
</span><a href="https://github.com/dbcls/sparql-proxy">https://github.com/dbcls/sparql-proxy</a><span style="font-family:"Arial","sans-serif";color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">It works fine there, but without nginx.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">When i put the container app inside Nginx, the application just does not start.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">Here is how my docker file looks like:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">#################<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"># Dockerfile for <a href="https://github.com/dbcls/sparql-proxy" target="_blank"><span style="color:#1155CC">https://github.com/dbcls/sparql-proxy</span></a><br>
#<br>
# Usage example:<br>
#<br>
# $ docker run -e PORT=3000 -e SPARQL_BACKEND=<a href="https://integbio.jp/rdf/ddbj/sparql" target="_blank"><span style="color:#1155CC">https://integbio.jp/rdf/ddbj/sparql</span></a> -e ADMIN_USER=admin -e ADMIN_PASSWORD=password -e CACHE_STORE=file -e CACHE_STORE_PATH=/opt/cache
 -e COMPRESSOR=snappy -e MAX_LIMIT=10000 -e JOB_TIMEOUT=300000 -e MAX_CONCURRENCY=1 -v `pwd`/files:/app/files -d -p 80:3000 -t sparql-proxy<br>
<br>
FROM node:10.15 as build-phase<br>
<br>
RUN useradd --create-home app<br>
RUN install --owner app --group app --directory /app<br>
<br>
USER app<br>
WORKDIR /app<br>
<br>
RUN git clone <a href="https://github.com/dbcls/sparql-proxy.git" target="_blank"><span style="color:#1155CC">https://github.com/dbcls/sparql-proxy.git</span></a> .<br>
<br>
RUN npm install<br>
RUN npm audit fix --force<br>
<br>
#COPY . .<br>
CMD npm start<br>
<br>
FROM nginxinc/nginx-unprivileged:1.16-alpine<br>
<br>
WORKDIR /usr/share/nginx/html<br>
<br>
COPY ./nginx.conf /etc/nginx/<br>
<br>
COPY --from=build-phase /app .<br>
<br>
EXPOSE 8080<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-bottom:double windowtext 6.75pt;padding:0cm 0cm 1.0pt 0cm;background:white">
<p class="MsoNormal" style="background:white;border:none;padding:0cm"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">and here is how my nginx.conf:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">###########<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">##1 Change to existing user “nginx” <br>
#user  nginx;<br>
<br>
worker_processes  1;<br>
<br>
events {<br>
    worker_connections  1024;<br>
}<br>
<br>
http {<br>
  client_body_temp_path /var/cache/nginx/ 1 2;<br>
  proxy_temp_path /var/cache/nginx/ 1 2;<br>
  fastcgi_temp_path /var/cache/nginx/ 1 2;<br>
  uwsgi_temp_path /var/cache/nginx/ 1 2;<br>
  scgi_temp_path /var/cache/nginx/ 1 2;<br>
<br>
  # Turn off the bloody buffering to temp files<br>
  proxy_buffering off;<br>
<br>
<br>
    server {<br>
        listen 8080;<br>
#        server_name  _;<br>
<br>
      location ~ ^/proxy/(.*)$ {<br>
      proxy_pass <a href="http://localhost:3000/$1$is_args$args" target="_blank"><span style="color:#1155CC">http://localhost:3000/$1$is_args$args</span></a>;<br>
      proxy_redirect / /proxy/;<br>
      proxy_cookie_path / /proxy/;<br>
      proxy_http_version 1.1;<br>
      proxy_set_header Upgrade $http_upgrade;<br>
      proxy_set_header Connection "upgrade";<br>
    }<br>
    <br>
location /health {<br>
return 200;<br>
}<br>
<br>
        location / {<br>
            try_files $uri $uri/ /index.html;<br>
        }<br>
    }<br>
}<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-bottom:double windowtext 6.75pt;padding:0cm 0cm 1.0pt 0cm;background:white">
<p class="MsoNormal" style="background:white;border:none;padding:0cm"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">In my deployment.yaml, I am using
</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF">containerPort:</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> 8080.</span><span style="font-family:"Arial","sans-serif";color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">This is how inside the container file structure:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><img border="0" width="1133" height="682" id="Picture_x0020_2" src="cid:image001.png@01D525FB.F2988B00"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">I just get this in the browser:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><img border="0" width="993" height="481" id="Picture_x0020_1" src="cid:image002.png@01D525FB.F2988B00"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">Any suggestion what is wrong in my docker file or nginx.conf?<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial","sans-serif";color:#222222">Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>