Skip to content

Commit

Permalink
Redirect 2020.bapc pages to index.html for JavaScript routing
Browse files Browse the repository at this point in the history
  • Loading branch information
mpsijm committed Mar 28, 2023
1 parent 5f50f77 commit ddea3ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ FROM wisvch/nginx
USER root
RUN sed -i -r '/server \{.*/a\ absolute_redirect off;' /etc/nginx/conf.d/default.conf
RUN sed -i -r 's/server_name.*/server_name "~^(?<year>\\d{4})\\.(?<domain>.+)$";/g' /etc/nginx/conf.d/default.conf
RUN sed -i -r '/index.htm;/a\ location ~ /(home|preliminaries|scoreboard-preliminaries|schedule|system|registration|rules|problems|scoreboard|organisation|contact)$ { if ($year = 2020) { rewrite ^.*$ /index.html last; } }' /etc/nginx/conf.d/default.conf
RUN sed -i -r '1,/root \/srv;/s//root \/srv\/$year;/' /etc/nginx/conf.d/default.conf
# Serve sample/code files as plain text, instead of downloading them
RUN sed -i -r '/location \/.*/a\ location ~ \\.(in|out|c|cpp|java|pas|py)$ { types {} default_type text/plain; }' /etc/nginx/conf.d/default.conf
RUN sed -i -r '/location \/.*/a\ location ~ \\.(in|out|c|cpp|java|pas|py)$ { types {} default_type text/plain; }' /etc/nginx/conf.d/default.conf
USER 100
COPY --link 2001.bapc.eu /srv/2001
COPY --link 2002.nwerc.eu /srv/2002
Expand Down

0 comments on commit ddea3ea

Please sign in to comment.