Skip to content

Commit

Permalink
Split the nginx.conf by separating locations directive
Browse files Browse the repository at this point in the history
This will split the nginx.conf file by separating the locations
directive into another file and including in nginx.conf

This is to make it work with images like `registry.access.redhat.com/ubi8/nginx-120`
where the nginx.conf is present and only locations directive is required

Also updates the UI dockerfile to copy the new file

Signed-off-by: Puneet Punamiya <[email protected]>
  • Loading branch information
PuneetPunamiya authored and tekton-robot committed Apr 29, 2022
1 parent 7c96355 commit 6417e89
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions images/ui.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ USER nginx
EXPOSE 8080

COPY ui/image/nginx.conf /etc/nginx/conf.d/default.conf
COPY ui/image/location.locations /etc/nginx/conf.d/location.locations

CMD /usr/bin/start.sh
8 changes: 8 additions & 0 deletions ui/image/location.locations
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
location / {
index index.html index.htm;
try_files $uri /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
12 changes: 2 additions & 10 deletions ui/image/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
include /etc/nginx/conf.d/location.locations;

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
Expand Down

0 comments on commit 6417e89

Please sign in to comment.